X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fstruct%2Fheap.h;h=d76678b2090757a4a2c05e05a2394121644254bf;hb=32d1445272120a254d77ce8d1af1f527da7a2c17;hp=7bddcba20ec01b75a6f0aabb4b0a9938c5c50748;hpb=c81265e6459403444c859758db53a9675c3a4ec7;p=bertos.git diff --git a/bertos/struct/heap.h b/bertos/struct/heap.h index 7bddcba2..d76678b2 100644 --- a/bertos/struct/heap.h +++ b/bertos/struct/heap.h @@ -71,7 +71,8 @@ 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)]; \ + STATIC_ASSERT(sizeof(name) % sizeof(heap_buf_t) == 0) /// 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); @@ -104,4 +105,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 */