diff options
Diffstat (limited to 'Zend/zend_alloc.h')
-rw-r--r-- | Zend/zend_alloc.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index d11618288..19cf49316 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_alloc.h,v 1.52.2.1 2004/08/11 06:13:12 derick Exp $ */ +/* $Id: zend_alloc.h,v 1.52.2.4 2005/06/07 13:37:13 derick Exp $ */ #ifndef ZEND_ALLOC_H #define ZEND_ALLOC_H @@ -85,8 +85,6 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN 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; -#define USE_ZEND_ALLOC 1 - #if USE_ZEND_ALLOC /* Standard wrapper macros */ @@ -124,15 +122,12 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE #define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size))) #define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s)) -#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):(empty_string)) -#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):(empty_string)) - #else #define _GNU_SOURCE #include <string.h> #undef _GNU_SOURCE - + /* Standard wrapper macros */ #define emalloc(size) malloc(size) #define safe_emalloc(nmemb, size, offset) malloc((nmemb) * (size) + (offset)) @@ -141,7 +136,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE #define erealloc(ptr, size) realloc((ptr), (size)) #define erealloc_recoverable(ptr, size) realloc((ptr), (size)) #define estrdup(s) strdup(s) -#define estrndup(s, length) strndup((s), (length)) +#define estrndup(s, length) zend_strndup((s), (length)) /* Relay wrapper macros */ #define emalloc_rel(size) malloc(size) @@ -151,7 +146,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE #define erealloc_rel(ptr, size) realloc((ptr), (size)) #define erealloc_recoverable_rel(ptr, size) realloc((ptr), (size)) #define estrdup_rel(s) strdup(s) -#define estrndup_rel(s, length) strndup((s), (length)) +#define estrndup_rel(s, length) zend_strndup((s), (length)) /* Selective persistent/non persistent allocation macros */ #define pemalloc(size, persistent) malloc(size) @@ -167,11 +162,10 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE #define perealloc_rel(ptr, size, persistent) realloc((ptr), (size)) #define perealloc_recoverable_rel(ptr, size, persistent) realloc((ptr), (size)) #define pestrdup_rel(s, persistent) strdup(s) +#endif /* !USE_ZEND_ALLOC */ -#define safe_estrdup(ptr) ((ptr)?(strdup(ptr)):(empty_string)) -#define safe_estrndup(ptr, len) ((ptr)?(strndup((ptr), (len))):(empty_string)) - -#endif +#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):(empty_string)) +#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):(empty_string)) ZEND_API int zend_set_memory_limit(unsigned int memory_limit); |