summaryrefslogtreecommitdiff
path: root/Zend/zend_ini.h
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-04-23 19:05:16 +0200
committerNikita Popov <nikic@php.net>2014-04-23 19:34:51 +0200
commit08ae88157b4f73154b2f1ffe72c3957edb3772fc (patch)
treeb4c1ae6e553379588d5b214d01297d476de3e4a7 /Zend/zend_ini.h
parent20580a511c029582fd2be6c8efbed40c89f7a874 (diff)
downloadphp-git-08ae88157b4f73154b2f1ffe72c3957edb3772fc.tar.gz
Allocate zend_strings with correct size
For me (32bit) sizeof(zend_string) is 20, which means that the char[1] array at the end is padded with three bytes. Thus allocating based on sizeof(zend_string)-1 overallocates by those 3 padding bytes. This commit fixes the allocation size, by using XtOffsetOf.
Diffstat (limited to 'Zend/zend_ini.h')
-rw-r--r--Zend/zend_ini.h30
1 files changed, 0 insertions, 30 deletions
diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h
index 8782ec6f20..0a0c1137e1 100644
--- a/Zend/zend_ini.h
+++ b/Zend/zend_ini.h
@@ -27,36 +27,6 @@
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
-#ifndef XtOffsetOf
-# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
-# ifdef __STDC__
-# define XtOffset(p_type, field) _Offsetof(p_type, field)
-# else
-# ifdef CRAY2
-# define XtOffset(p_type, field) \
- (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
-
-# else /* !CRAY2 */
-
-# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
-
-# endif /* !CRAY2 */
-# endif /* __STDC__ */
-# else /* ! (CRAY || __arm) */
-
-# define XtOffset(p_type, field) \
- ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
-
-# endif /* !CRAY */
-
-# ifdef offsetof
-# define XtOffsetOf(s_type, field) offsetof(s_type, field)
-# else
-# define XtOffsetOf(s_type, field) XtOffset(s_type*, field)
-# endif
-
-#endif
-
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)
#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)