]> granicus.if.org Git - php/commitdiff
Add unicode macros for when Zend memory manager is disabled.
authorAndrei Zmievski <andrei@php.net>
Fri, 12 Aug 2005 17:14:21 +0000 (17:14 +0000)
committerAndrei Zmievski <andrei@php.net>
Fri, 12 Aug 2005 17:14:21 +0000 (17:14 +0000)
Zend/zend_alloc.h

index fc0edf0a4d39ed1d4881aa08bad80d90f9d4ef20..9ba2803a4643a0bc1d501e835e50a0e691e1dafa 100644 (file)
@@ -151,6 +151,10 @@ ZEND_API UChar *_eustrndup(const UChar *s, int32_t length ZEND_FILE_LINE_DC ZEND
 #define erealloc_recoverable(ptr, size)        realloc((ptr), (size))
 #define estrdup(s)                                             strdup(s)
 #define estrndup(s, length)                            zend_strndup((s), (length))
+#define eumalloc(size)                                 (UChar*)malloc(UBYTES(size))
+#define eurealloc(ptr, size)                   (UChar*)erealloc((ptr), UBYTES(size))
+#define eustrndup(s, length)                   zend_ustrndup((s), (length))
+#define eustrdup(s)                                            zend_ustrdup((s), u_strlen(s))
 
 /* Relay wrapper macros */
 #define emalloc_rel(size)                                      malloc(size)
@@ -161,6 +165,9 @@ ZEND_API UChar *_eustrndup(const UChar *s, int32_t length ZEND_FILE_LINE_DC ZEND
 #define erealloc_recoverable_rel(ptr, size)    realloc((ptr), (size))
 #define estrdup_rel(s)                                         strdup(s)
 #define estrndup_rel(s, length)                                zend_strndup((s), (length))
+#define eumalloc_rel(size)                                     (UChar*)malloc(UBYTES(size))
+#define eurealloc_rel(ptr, size)                       (UChar*)realloc((ptr), UBYTES(size))
+#define eustrndup_rel(s, length)                       zend_ustrndup((s), (length))
 
 /* Selective persistent/non persistent allocation macros */
 #define pemalloc(size, persistent)             malloc(size)
@@ -170,6 +177,8 @@ ZEND_API UChar *_eustrndup(const UChar *s, int32_t length ZEND_FILE_LINE_DC ZEND
 #define perealloc(ptr, size, persistent)               realloc((ptr), (size))
 #define perealloc_recoverable(ptr, size, persistent)   realloc((ptr), (size))
 #define pestrdup(s, persistent)                        strdup(s)
+#define peumalloc(size, persistent) (UChar*)malloc(UBYTES(size))
+#define peurealloc(ptr, size, persistent) (UChar*)realloc((ptr),UBYTES(size))
 
 #define pemalloc_rel(size, persistent)         malloc(size)
 #define pefree_rel(ptr, persistent)                    free(ptr)