Backport: Fix bug 794: recover 3 bytes wasted per memory chunk. Fix from rovv.
svn:r16449
o Minor bugfixes:
- Fix a small alignment and memory-wasting bug on buffer chunks. Spotted
by rovv.
+ - Recover 3-7 bytes that were wasted per memory chunk. Fixes bug
+ 794; bug spotted by rovv. Bugfix on 0.2.0.1-alpha.
Changes in version 0.2.0.30 - 2008-07-15
};
/** Number of extra bytes needed beyond mem_size to allocate a chunk. */
-#define CHUNK_OVERHEAD (sizeof(mp_chunk_t)-1)
+#define CHUNK_OVERHEAD STRUCT_OFFSET(mp_chunk_t, mem[0])
/** Given a pointer to a mp_allocated_t, return a pointer to the memory
* item it holds. */