TI BLE5-Stack API Documentation  2.02.07.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  */
29 #include "comdef.h"
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 
61  void osal_mem_init( void );
62 
70  void osal_mem_kick( void );
71 
73 
74  /*
75  * Allocate a block of memory.
76  */
77 #ifdef DPRINTF_OSALHEAPTRACE
78  void *osal_mem_alloc_dbg( uint16 size, const char *fname, unsigned lnum );
79 #define osal_mem_alloc(_size ) osal_mem_alloc_dbg(_size, __FILE__, __LINE__)
80 #else /* DPRINTF_OSALHEAPTRACE */
81 
86  void *osal_mem_alloc( uint16 size );
87 #endif /* DPRINTF_OSALHEAPTRACE */
88 
95 void *osal_mem_allocLimited( uint16 size );
96 
97  /*
98  * Free a block of memory.
99  */
100 #ifdef DPRINTF_OSALHEAPTRACE
101  void osal_mem_free_dbg( void *ptr, const char *fname, unsigned lnum );
102 #define osal_mem_free(_ptr ) osal_mem_free_dbg(_ptr, __FILE__, __LINE__)
103 #else /* DPRINTF_OSALHEAPTRACE */
104 
109  void osal_mem_free( void *ptr );
110 #endif /* DPRINTF_OSALHEAPTRACE */
111 
112 #if ( OSALMEM_METRICS )
113 
118  uint16 osal_heap_block_max( void );
119 
125  uint16 osal_heap_block_cnt( void );
126 
132  uint16 osal_heap_block_free( void );
133 
139  uint16 osal_heap_mem_used( void );
140 #endif
141 
142 #if defined (ZTOOL_P1) || defined (ZTOOL_P2)
143 
148  uint16 osal_heap_high_water( void );
149 #endif
150 
151 /*********************************************************************
152 *********************************************************************/
153 
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #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-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale