use offset instead of manually calculated header size
[tedtools.git] / tmalloc.h
index 4cb0a0b..cc10c33 100644 (file)
--- a/tmalloc.h
+++ b/tmalloc.h
@@ -72,7 +72,7 @@ typedef struct {
        char    data[1];        
 } MCAllocatedSpace;
 
-#define MCASHDRSZ ( sizeof(size_t) + sizeof(MemoryContext*) )
+#define MCASHDRSZ offsetof(MCAllocatedSpace, data)
 #define MCMAGICKNUMBER (0xFE0FBEEF)
 
 MemoryContext *allocMemoryContext(MemoryContext* parent, int flags);