Use offsetof macro where possible to defined header size;
[tedtools.git] / tmalloc.h
index a39a3ff..67069eb 100644 (file)
--- a/tmalloc.h
+++ b/tmalloc.h
@@ -55,7 +55,7 @@ typedef struct MemoryChunk {
        char data[1];
 } MemoryChunk;
 
-#define MEMCHNKHDRSZ   ( sizeof(u_int32_t)*2 + sizeof(MemoryChunk*) )
+#define MEMCHNKHDRSZ   offsetof(MemoryChunk, data)
 
 typedef struct MemoryContext {
        u_int32_t       flags;