summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-08-06 16:22:25 +0000
committerNick Mathewson <nickm@torproject.org>2008-08-06 16:22:25 +0000
commit2905291af2c3719bdd482e8c6f59ec983fe0e827 (patch)
treecd2dc819ebdff3ee8f520b4016ac3738cf2572c1 /src/common
parent37432c06ef9d763d6751e2a78c85d52d8b77d327 (diff)
downloadtor-2905291af2c3719bdd482e8c6f59ec983fe0e827.tar.gz
tor-2905291af2c3719bdd482e8c6f59ec983fe0e827.zip
r17659@tombo: nickm | 2008-08-06 12:22:11 -0400
Fix bug 794: recover 3 bytes wasted per memory chunk. Fix from rovv. svn:r16447
Diffstat (limited to 'src/common')
-rw-r--r--src/common/mempool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/mempool.c b/src/common/mempool.c
index 6a41d220fe..d489cf6550 100644
--- a/src/common/mempool.c
+++ b/src/common/mempool.c
@@ -144,7 +144,7 @@ struct mp_chunk_t {
};
/** 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. */