diff options
author | Anatol Belski <ab@php.net> | 2014-08-16 11:16:11 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-08-16 11:16:11 +0200 |
commit | 8ee2a4a9b5de682c0b37670e1f4f86242b1650ce (patch) | |
tree | 7768898294c125f79de082a986e962aa6cb23094 /Zend/zend_alloc.h | |
parent | 735ec33b828bc4429c4ec8de7ba547925a4b44e3 (diff) | |
download | php-git-8ee2a4a9b5de682c0b37670e1f4f86242b1650ce.tar.gz |
first shot on merging the core fro the int64 branch
Diffstat (limited to 'Zend/zend_alloc.h')
-rw-r--r-- | Zend/zend_alloc.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index 609db22dac..3c143419ae 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -26,20 +26,21 @@ #include "../TSRM/TSRM.h" #include "zend.h" +#include "zend_types.h" #ifndef ZEND_MM_ALIGNMENT -# define ZEND_MM_ALIGNMENT 8 -# define ZEND_MM_ALIGNMENT_LOG2 3 -#elif ZEND_MM_ALIGNMENT < 4 +# define ZEND_MM_ALIGNMENT Z_I(8) +# define ZEND_MM_ALIGNMENT_LOG2 Z_I(3) +#elif ZEND_MM_ALIGNMENT < Z_I(4) # undef ZEND_MM_ALIGNMENT # undef ZEND_MM_ALIGNMENT_LOG2 -# define ZEND_MM_ALIGNMENT 4 -# define ZEND_MM_ALIGNMENT_LOG2 2 +# define ZEND_MM_ALIGNMENT Z_I(4) +# define ZEND_MM_ALIGNMENT_LOG2 Z_I(2) #endif -#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1) +#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-Z_I(1)) -#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK) +#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - Z_I(1)) & ZEND_MM_ALIGNMENT_MASK) typedef struct _zend_leak_info { void *addr; @@ -52,7 +53,7 @@ typedef struct _zend_leak_info { BEGIN_EXTERN_C() -ZEND_API char *zend_strndup(const char *s, unsigned int length) ZEND_ATTRIBUTE_MALLOC; +ZEND_API char *zend_strndup(const char *s, zend_size_t length) ZEND_ATTRIBUTE_MALLOC; ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_ALLOC_SIZE(1); ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC; @@ -63,7 +64,7 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN ZEND_API void *_safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); ZEND_API void *_safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset); ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC; -ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC; +ZEND_API char *_estrndup(const char *s, zend_size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC; ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); /* Standard wrapper macros */ |