From: teodor Date: Thu, 21 Jan 2010 14:09:19 +0000 (+0000) Subject: use offset instead of manually calculated header size X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=e8eed69019a2d7c048a9a7ed2bf4e1739678cb93;hp=7282b0cafacea9d23bfe67f3650f7b89ac7851cb;p=tedtools.git use offset instead of manually calculated header size --- 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);