TI BLE-Stack for Bluetooth 4.2 API Documentation  3.02.02.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  * Free a block of memory.
98  */
99 #ifdef DPRINTF_OSALHEAPTRACE
100  void osal_mem_free_dbg( void *ptr, const char *fname, unsigned lnum );
101 #define osal_mem_free(_ptr ) osal_mem_free_dbg(_ptr, __FILE__, __LINE__)
102 #else /* DPRINTF_OSALHEAPTRACE */
103 
108  void osal_mem_free( void *ptr );
109 #endif /* DPRINTF_OSALHEAPTRACE */
110 
111 #if ( OSALMEM_METRICS )
112 
117  uint16 osal_heap_block_max( void );
118 
124  uint16 osal_heap_block_cnt( void );
125 
131  uint16 osal_heap_block_free( void );
132 
138  uint16 osal_heap_mem_used( void );
139 #endif
140 
141 #if defined (ZTOOL_P1) || defined (ZTOOL_P2)
142 
147  uint16 osal_heap_high_water( void );
148 #endif
149 
150 /*********************************************************************
151 *********************************************************************/
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #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-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale