summaryrefslogtreecommitdiff
path: root/ext/standard/php_smart_str.h
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-09-19 21:34:05 +0200
committerNikita Popov <nikic@php.net>2014-09-19 23:39:07 +0200
commit070667de8db929454aee13c5185b165554c00c55 (patch)
tree56015b79f3bb0f3cbcb68211737c43a68db0a373 /ext/standard/php_smart_str.h
parentc7446bbd3908f7e12f08e21de084b20dea0e64e1 (diff)
downloadphp-git-070667de8db929454aee13c5185b165554c00c55.tar.gz
Remove SMART_STR_USE_REALLOC
Diffstat (limited to 'ext/standard/php_smart_str.h')
-rw-r--r--ext/standard/php_smart_str.h18
1 files changed, 1 insertions, 17 deletions
diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h
index 8027c4c87f..57590f561d 100644
--- a/ext/standard/php_smart_str.h
+++ b/ext/standard/php_smart_str.h
@@ -24,9 +24,7 @@
#include "php_smart_str_public.h"
#include <stdlib.h>
-#ifndef SMART_STR_USE_REALLOC
#include <zend.h>
-#endif
#define smart_str_0(x) do { \
if ((x)->s) { \
@@ -42,20 +40,6 @@
#define SMART_STR_START_SIZE 78
#endif
-
-#ifdef SMART_STR_USE_REALLOC
-#define SMART_STR_DO_REALLOC(b, w) do { \
- int oldlen = (b)->s->len; \
- (b)->s = erealloc((buf)->s, _STR_HEADER_SIZE + (b)->a + 1); \
- (b)->s->len = oldlen; \
-} while (0)
-#else
-#define SMART_STR_DO_REALLOC(b, w) do { \
- (b)->s = perealloc((b)->s, _STR_HEADER_SIZE + (b)->a + 1, (w)); \
-} while (0)
-#endif
-
-
#define smart_str_alloc4(d, n, what, newlen) do { \
if (!(d)->s) { \
newlen = (n); \
@@ -68,7 +52,7 @@
newlen = (d)->s->len + (n); \
if (newlen >= (d)->a) { \
(d)->a = newlen + SMART_STR_PREALLOC; \
- SMART_STR_DO_REALLOC((d), (what)); \
+ (d)->s = perealloc((d)->s, _STR_HEADER_SIZE + (d)->a + 1, (what)); \
} \
} \
} while (0)