summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-01-29 09:14:22 +0000
committerAndi Gutmans <andi@php.net>2000-01-29 09:14:22 +0000
commitb862a8b728f0be304cb1589cb6c8e4d2fc3f02df (patch)
treea614ac32a894770e4384175820a8a0426ad9be1e
parent5da185594c1ae93de36a25d797909fe3d9d7eedc (diff)
downloadphp-git-b862a8b728f0be304cb1589cb6c8e4d2fc3f02df.tar.gz
- This will save some memory w/ GCC compilers on some platforms
-rw-r--r--Zend/zend_alloc.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h
index e1674612c4..99c3db12c0 100644
--- a/Zend/zend_alloc.h
+++ b/Zend/zend_alloc.h
@@ -54,8 +54,12 @@ typedef union _align_test {
#define MAX_CACHED_MEMORY 64
#define MAX_CACHED_ENTRIES 16
-
+#if (defined (__GNUC__) && __GNUC__ >= 2)
+#define PLATFORM_ALIGNMENT (__alignof__ (zend_mem_header))
+#else
#define PLATFORM_ALIGNMENT (sizeof(align_test))
+#endif
+
#define PLATFORM_PADDING (((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)
ZEND_API char *zend_strndup(const char *s, unsigned int length);