From 221d961e02590bade0cc9496de4dd830c5454a75 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Tue, 7 Jun 2005 13:37:13 +0000 Subject: [PATCH] - MFH: Added the --disable-zend-memory-manager switch to disable the Zend memory manager. #- I discussed this with Dmitry today - we found it useful. --- Zend/zend_alloc.h | 2 -- configure.in | 10 ++++++++++ ext/standard/info.c | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index 07a100d483..448c1cbf75 100644 --- a/Zend/zend_alloc.h +++ b/Zend/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 */ diff --git a/configure.in b/configure.in index d17899b9cf..2032238eb3 100644 --- a/configure.in +++ b/configure.in @@ -677,6 +677,16 @@ else ZEND_DEBUG=no fi +PHP_ARG_ENABLE(zend-memory-manager,whether to enable the Zend memory manager, +[ --disable-zend-memory-manager + Disable the Zend memory manager (DEVELOPERS ONLY)],yes, no) + +if test "$PHP_ZEND_MEMORY_MANAGER" = "yes"; then + AC_DEFINE(USE_ZEND_ALLOC, 1, [ ]) +else + AC_DEFINE(USE_ZEND_ALLOC, 0, [ ]) +fi + PHP_ARG_WITH(layout,[layout of installed files], [ --with-layout=TYPE Sets how installed files will be laid out. Type is one of "PHP" (default) or "GNU"], PHP, no) diff --git a/ext/standard/info.c b/ext/standard/info.c index 3b166d6ccc..95c37a09fb 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -469,6 +469,12 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) php_info_print_table_row(2, "Thread Safety", "disabled" ); #endif +#if USE_ZEND_ALLOC + php_info_print_table_row(2, "Zend Memory Manager", "enabled" ); +#else + php_info_print_table_row(2, "Zend Memory Manager", "disabled" ); +#endif + #if HAVE_IPV6 php_info_print_table_row(2, "IPv6 Support", "enabled" ); #else -- 2.40.0