121 #ifndef ti_sysbios_heaps_HeapBuf__include 122 #define ti_sysbios_heaps_HeapBuf__include 138 #define ti_sysbios_heaps_HeapBuf_long_names 139 #include "HeapBuf_defs.h" 156 #define HeapBuf_A_nullBuf "buf parameter cannot be null" 164 #define HeapBuf_A_bufAlign "buf not properly aligned" 172 #define HeapBuf_A_invalidAlign "align parameter must be 0 or a power of 2 >= the value of Memory_getMaxDefaultTypeAlign()" 181 #define HeapBuf_A_invalidRequestedAlign "align parameter 1) must be 0 or a power of 2 and 2) not greater than the heaps alignment" 187 #define HeapBuf_A_invalidBlockSize "blockSize must be large enough to hold at least two pointers" 192 #define HeapBuf_A_zeroBlocks "numBlocks cannot be zero" 197 #define HeapBuf_A_zeroBufSize "bufSize cannot be zero" 205 #define HeapBuf_A_invalidBufSize "HeapBuf_create's bufSize parameter is invalid (too small)" 212 #define HeapBuf_A_noBlocksToFree "Cannot call HeapBuf_free when no blocks have been allocated" 227 #define HeapBuf_A_invalidFree "Invalid free" 232 #define HeapBuf_E_size "requested size is too big: handle=0x%x, size=%u" 415 } HeapBuf_Module_State;
425 #define ti_sysbios_heaps_HeapBuf_Handle_upCast(handle) ((IHeap_Handle)(handle)) 451 extern void HeapBuf_free(HeapBuf_Handle heap,
void * buf,
size_t size);
560 extern size_t HeapBuf_getBlockSize(HeapBuf_Handle heap);
562 extern void HeapBuf_mergeHeapBufs(HeapBuf_Handle h1, HeapBuf_Handle h2);
566 return ((HeapBuf_Handle)str);
574 #define HeapBuf_module ((HeapBuf_Module_State *) &(HeapBuf_Module_state)) 584 #undef ti_sysbios_heaps_HeapBuf_long_names 585 #include "HeapBuf_defs.h" HeapBuf_Handle HeapBuf_Object_next(HeapBuf_Handle heap)
return handle of the next HeapBuf on HeapBuf list
unsigned int minFreeBlocks
Definition: HeapBuf.h:406
Queue_Struct freeList
Definition: HeapBuf.h:407
bool HeapBuf_isBlocking(HeapBuf_Handle heap)
This function always returns false since the alloc/free never block on a resource.
size_t blockSize
Size (in MAUs) of each block.
Definition: HeapBuf.h:344
char * buf
User supplied buffer; for dynamic creates only.
Definition: HeapBuf.h:404
void * HeapBuf_alloc(HeapBuf_Handle heap, size_t size, size_t align, Error_Block *eb)
All alignment is handled in the create, therefore the align argument in alloc is ignored.
Static and run-time memory manager.
unsigned int numBlocks
Number of fixed-size blocks.
Definition: HeapBuf.h:281
size_t bufSize
Size (in MAUs) of the entire buffer; for dynamic creates only.
Definition: HeapBuf.h:389
void HeapBuf_free(HeapBuf_Handle heap, void *buf, size_t size)
Opaque queue element.
Definition: Queue.h:204
unsigned int numFreeBlocks
Definition: HeapBuf.h:405
HeapBuf_Handle HeapBuf_Object_first(void)
return handle of the first HeapBuf on HeapBuf list
unsigned int numAllocatedBlocks
The total number of blocks currently allocated in this HeapBuf instance.
Definition: HeapBuf.h:250
Queue_Elem objElem
Definition: HeapBuf.h:331
size_t align
Alignment (in MAUs) of each block.
Definition: HeapBuf.h:273
Definition: HeapBuf.h:329
unsigned int numBlocks
Number of fixed-size blocks.
Definition: HeapBuf.h:372
Error block.
Definition: Error.h:152
unsigned int maxAllocatedBlocks
The maximum number of blocks allocated from this heap at any single point in time, during the lifetime of this HeapBuf instance. The configuration parameter HeapBuf.trackMaxAllocs must be set to true for this field to have any meaning. Otherwise, this field will be set to '0'.
Definition: HeapBuf.h:245
struct HeapBuf_Struct * HeapBuf_Handle
size_t bufSize
Size (in MAUs) of the entire buffer; for dynamic creates only.
Definition: HeapBuf.h:311
void HeapBuf_getExtendedStats(HeapBuf_Handle heap, HeapBuf_ExtendedStats *statBuf)
Retrieves the extended statistics for a HeapBuf instance.
void HeapBuf_delete(HeapBuf_Handle *heap)
Delete a HeapBuf heap.
size_t blockSize
Size (in MAUs) of each block.
Definition: HeapBuf.h:294
void * buf
User supplied buffer; for dynamic creates only.
Definition: HeapBuf.h:326
HeapBuf_Struct HeapBuf_Object
Definition: HeapBuf.h:410
Interface to heap functions.
void HeapBuf_Params_init(HeapBuf_Params *prms)
Initialize the HeapBuf_Params structure with default values.
HeapBuf_Handle HeapBuf_construct(HeapBuf_Struct *obj, const HeapBuf_Params *params, Error_Block *eb)
Construct a HeapBuf heap.
Memory heap statistics.
Definition: Memory.h:94
IHeap_Object iheap
Definition: HeapBuf.h:330
size_t align
Alignment (in MAUs) of each block.
Definition: HeapBuf.h:364
void HeapBuf_destruct(HeapBuf_Struct *obj)
Destruct a HeapBuf heap.
HeapBuf_Handle HeapBuf_create(const HeapBuf_Params *params, Error_Block *eb)
Create a HeapBuf heap.
Stat structure for the HeapBuf_getExtendedStats function.
Definition: HeapBuf.h:237
void HeapBuf_getStats(HeapBuf_Handle heap, Memory_Stats *statBuf)
This function returns state information for a HeapBuf.
Definition: HeapBuf.h:253