X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fstruct%2Fheap.h;h=efd02c284ad5a7ffd9544cc8315bf37b521399c4;hb=f884c67ed85598875ef683987323fd6085e01e14;hp=b58bbed17f5a2bea7a7a596148d8420deef6eb50;hpb=eec53a0483a101e131d4fa38becaf1c8fb069d5e;p=bertos.git diff --git a/bertos/struct/heap.h b/bertos/struct/heap.h index b58bbed1..efd02c28 100644 --- a/bertos/struct/heap.h +++ b/bertos/struct/heap.h @@ -38,6 +38,9 @@ * * \version $Id$ * \author Bernie Innocenti + * + * $WIZ$ module_name = "heap" + * $WIZ$ module_configuration = "bertos/cfg/cfg_heap.h" */ #ifndef STRUCT_HEAP_H @@ -71,7 +74,7 @@ typedef struct Heap * \param size Heap size in bytes. */ #define HEAP_DEFINE_BUF(name, size) \ - heap_buf_t name[((size) + sizeof(heap_buf_t) - 1) / sizeof(heap_buf_t)]; + heap_buf_t name[((size) + sizeof(heap_buf_t) - 1) / sizeof(heap_buf_t)] /// Initialize \a heap within the buffer pointed by \a memory which is of \a size bytes void heap_init(struct Heap* heap, void* memory, size_t size); @@ -82,6 +85,7 @@ void *heap_allocmem(struct Heap* heap, size_t size); /// Free a chunk of memory of \a size bytes from the heap void heap_freemem(struct Heap* heap, void *mem, size_t size); +size_t heap_freeSpace(struct Heap *h); #define HNEW(heap, type) \ (type*)heap_allocmem(heap, sizeof(type))