From 1f12ada0f797ac9a5625823cc8d10d1b4b5fbc23 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 14 Sep 2006 08:55:17 +0000 Subject: [PATCH] Added is_zend_mm() to allow runtime check for zend memory manager --- Zend/zend_alloc.c | 9 +++++++++ Zend/zend_alloc.h | 1 + 2 files changed, 10 insertions(+) diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 840387548c..ca8aab1a26 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -1619,6 +1619,15 @@ static int alloc_globals_id; static zend_alloc_globals alloc_globals; #endif +ZEND_API int is_zend_mm(TSRMLS_D) +{ +#if ZEND_USE_MALLOC_MM + return AG(mm_heap)->use_zend_alloc; +#else + return 1; +#endif +} + ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { TSRMLS_FETCH(); diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index 842a6e552d..1befb7475c 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -106,6 +106,7 @@ ZEND_API int zend_set_memory_limit(unsigned int memory_limit); ZEND_API void start_memory_manager(TSRMLS_D); ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC); +ZEND_API int is_zend_mm(TSRMLS_D); #if ZEND_DEBUG ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -- 2.50.1