summaryrefslogtreecommitdiff
path: root/Zend/zend_alloc.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-04-16 14:45:08 +0300
committerDmitry Stogov <dmitry@zend.com>2015-04-16 14:45:08 +0300
commite38ed4c28ffe56f910626870667b374ac5ad1481 (patch)
treec6681c4d7f855cb94515930b1c45aee1a1ae4251 /Zend/zend_alloc.h
parent05232cc810b39ff6f5a0307119bd76a548fe34be (diff)
downloadphp-git-e38ed4c28ffe56f910626870667b374ac5ad1481.tar.gz
Changed zend_smart_str allocation granularity to do the better job together with Zend MM and avoid useless calls to erealloc().
The actual reallocation routiones are seprated from inlined code to reduce code size.
Diffstat (limited to 'Zend/zend_alloc.h')
-rw-r--r--Zend/zend_alloc.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h
index 6d89884f0d..0cb3a71d34 100644
--- a/Zend/zend_alloc.h
+++ b/Zend/zend_alloc.h
@@ -50,6 +50,20 @@ typedef struct _zend_leak_info {
uint orig_lineno;
} zend_leak_info;
+#if ZEND_DEBUG
+typedef struct _zend_mm_debug_info {
+ size_t size;
+ const char *filename;
+ const char *orig_filename;
+ uint lineno;
+ uint orig_lineno;
+} zend_mm_debug_info;
+
+# define ZEND_MM_OVERHEAD ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_debug_info))
+#else
+# define ZEND_MM_OVERHEAD 0
+#endif
+
BEGIN_EXTERN_C()
ZEND_API char* ZEND_FASTCALL zend_strndup(const char *s, size_t length) ZEND_ATTRIBUTE_MALLOC;