[dovecot-cvs] dovecot/src/lib mempool-system-clean.c,1.3,1.4

tss at dovecot.org tss at dovecot.org
Thu Mar 22 00:49:39 EET 2007


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv25008

Modified Files:
	mempool-system-clean.c 
Log Message:
Actually use MEM_ALIGN_SIZE to get the alignment right



Index: mempool-system-clean.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/mempool-system-clean.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mempool-system-clean.c	21 Mar 2007 22:40:15 -0000	1.3
+++ mempool-system-clean.c	21 Mar 2007 22:49:37 -0000	1.4
@@ -17,8 +17,13 @@
 #  include <gc.h>
 #endif
 
-/* Always give 64 bits to the size so returned memory is always 64bit aligned */
-#define EXTRA_SIZE_SPACE 8
+/* use the maximum of required memory alignment and sizeof(void *)
+   (sizeof(size_t) is assumed to be same. it always is.) */
+#if MEM_ALIGN_SIZE > SIZEOF_VOID_P
+#  define EXTRA_SIZE_SPACE MEM_ALIGN_SIZE
+#else
+#  define EXTRA_SIZE_SPACE SIZEOF_VOID_P
+#endif
 
 #undef HAVE_MALLOC_USABLE_SIZE
 static const char *pool_system_clean_get_name(pool_t pool);



More information about the dovecot-cvs mailing list