From e8eed69019a2d7c048a9a7ed2bf4e1739678cb93 Mon Sep 17 00:00:00 2001 From: teodor Date: Thu, 21 Jan 2010 14:09:19 +0000 Subject: [PATCH] use offset instead of manually calculated header size --- tmalloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmalloc.h b/tmalloc.h index 4cb0a0b..cc10c33 100644 --- 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); -- 2.46.1