[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r16447: {tor} Fix bug 794: recover 3 bytes wasted per memory chunk. Fix fr (in tor/trunk: . src/common)
Author: nickm
Date: 2008-08-06 12:22:25 -0400 (Wed, 06 Aug 2008)
New Revision: 16447
Modified:
tor/trunk/
tor/trunk/ChangeLog
tor/trunk/src/common/mempool.c
Log:
r17659@tombo: nickm | 2008-08-06 12:22:11 -0400
Fix bug 794: recover 3 bytes wasted per memory chunk. Fix from rovv.
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r17659] on 49666b30-7950-49c5-bedf-9dc8f3168102
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2008-08-06 16:04:52 UTC (rev 16446)
+++ tor/trunk/ChangeLog 2008-08-06 16:22:25 UTC (rev 16447)
@@ -4,7 +4,11 @@
IPv6 addresses.
- Generate and accept IPv6 addresses in many protocol elements.
+ o Minor bugfixes:
+ - 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.1.4-alpha - 2008-08-04
o Major bugfixes:
- The address part of exit policies was not correctly written
Modified: tor/trunk/src/common/mempool.c
===================================================================
--- tor/trunk/src/common/mempool.c 2008-08-06 16:04:52 UTC (rev 16446)
+++ tor/trunk/src/common/mempool.c 2008-08-06 16:22:25 UTC (rev 16447)
@@ -144,7 +144,7 @@
};
/** 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. */