X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=bertos%2Fstruct%2Fheap.h;h=fc36cc7bf910f0fea2b4ebda92b340ad04c730fc;hb=b46f64914c62fbb0297728280478681659469654;hp=7bddcba20ec01b75a6f0aabb4b0a9938c5c50748;hpb=c81265e6459403444c859758db53a9675c3a4ec7;p=bertos.git diff --git a/bertos/struct/heap.h b/bertos/struct/heap.h index 7bddcba2..fc36cc7b 100644 --- a/bertos/struct/heap.h +++ b/bertos/struct/heap.h @@ -36,8 +36,10 @@ * in this form also within the implementation. This would probably remove * memory alignment problems, and also some aliasing issues. * - * \version $Id$ * \author Bernie Innocenti + * + * $WIZ$ module_name = "heap" + * $WIZ$ module_configuration = "bertos/cfg/cfg_heap.h" */ #ifndef STRUCT_HEAP_H @@ -71,7 +73,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 +84,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)) @@ -104,4 +107,8 @@ void heap_free(struct Heap* heap, void * mem); #endif +int heap_testSetup(void); +int heap_testRun(void); +int heap_testTearDown(void); + #endif /* STRUCT_HEAP_H */