diff options
author | Dmitry Stogov <dmitry@php.net> | 2006-09-14 08:00:44 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2006-09-14 08:00:44 +0000 |
commit | 27c327b97e1ffa68fe22c252ca7d24ecd073c699 (patch) | |
tree | ecf1288faeaf132b4871f719deaf2863c22d84eb | |
parent | 38540337a90400b249953e14661f4364e299b6d6 (diff) | |
download | php-git-27c327b97e1ffa68fe22c252ca7d24ecd073c699.tar.gz |
Added is_zend_mm() to allow runtime check for zend memory manager
-rw-r--r-- | Zend/zend_alloc.c | 9 | ||||
-rw-r--r-- | Zend/zend_alloc.h | 1 |
2 files changed, 10 insertions, 0 deletions
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); |