X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fstruct%2Fheap.h;h=d76678b2090757a4a2c05e05a2394121644254bf;hb=32d1445272120a254d77ce8d1af1f527da7a2c17;hp=b58bbed17f5a2bea7a7a596148d8420deef6eb50;hpb=fe0a14d1434098bfd0780d06a2a7e55f27940d27;p=bertos.git diff --git a/bertos/struct/heap.h b/bertos/struct/heap.h index b58bbed1..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);