Merge branch "preempt" in "trunk".
[bertos.git] / bertos / struct / heap.h
index b58bbed17f5a2bea7a7a596148d8420deef6eb50..d76678b2090757a4a2c05e05a2394121644254bf 100644 (file)
@@ -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);