From 27c327b97e1ffa68fe22c252ca7d24ecd073c699 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 14 Sep 2006 08:00:44 +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 d2bb14cb28..c132175737 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 c8eecb99e9..70670d1f17 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -95,6 +95,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