TI BLE5-Stack API Documentation  9.14.00
osal_memory.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, LPC, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: BSD3 2004 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
18 #ifndef OSAL_MEMORY_H
19 #define OSAL_MEMORY_H
20 
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif
25 
26 /*********************************************************************
27  * INCLUDES
28  */
30 
31 /*********************************************************************
32  * CONSTANTS
33  */
34 
35 #if !defined ( OSALMEM_METRICS )
36  #define OSALMEM_METRICS FALSE
37 #endif
38 
39 /*********************************************************************
40  * MACROS
41  */
42 
44 #define osal_stack_used() OnBoard_stack_used()
45 
46 /*********************************************************************
47  * TYPEDEFS
48  */
49 
50 /*********************************************************************
51  * GLOBAL VARIABLES
52  */
53 
54 /*********************************************************************
55  * FUNCTIONS
56  */
57 
59 
60  /*
61  * Allocate a block of memory.
62  */
63 #ifdef DPRINTF_OSALHEAPTRACE
64  void *osal_mem_alloc_dbg( uint16 size, const char *fname, unsigned lnum );
65 #define osal_mem_alloc(_size ) osal_mem_alloc_dbg(_size, __FILE__, __LINE__)
66 #else /* DPRINTF_OSALHEAPTRACE */
67 
72  void *osal_mem_alloc( uint16 size );
73 #endif /* DPRINTF_OSALHEAPTRACE */
74 
81 void *osal_mem_allocLimited( uint16 size );
82 
83  /*
84  * Free a block of memory.
85  */
86 #ifdef DPRINTF_OSALHEAPTRACE
87  void osal_mem_free_dbg( void *ptr, const char *fname, unsigned lnum );
88 #define osal_mem_free(_ptr ) osal_mem_free_dbg(_ptr, __FILE__, __LINE__)
89 #else /* DPRINTF_OSALHEAPTRACE */
90 
95  void osal_mem_free( void *ptr );
96 #endif /* DPRINTF_OSALHEAPTRACE */
97 
98 #if ( OSALMEM_METRICS )
99 
104  uint16 osal_heap_block_max( void );
105 
111  uint16 osal_heap_block_cnt( void );
112 
118  uint16 osal_heap_block_free( void );
119 
125  uint16 osal_heap_mem_used( void );
126 #endif
127 
128 #if defined (ZTOOL_P1) || defined (ZTOOL_P2)
129 
134  uint16 osal_heap_high_water( void );
135 #endif
136 
137 /*********************************************************************
138 *********************************************************************/
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 #endif /* #ifndef OSAL_MEMORY_H */
Common Defines.
void * osal_mem_alloc(uint16 size)
Implement the OSAL dynamic memory allocation functionality.
void osal_mem_free(void *ptr)
Implement the OSAL dynamic memory de-allocation functionality.
void * osal_mem_allocLimited(uint16 size)
Implement the OSAL dynamic memory allocation functionality. However, a first check is done to ensure ...
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale