]> granicus.if.org Git - php/commitdiff
Added is_zend_mm() to allow runtime check for zend memory manager
authorDmitry Stogov <dmitry@php.net>
Thu, 14 Sep 2006 08:55:17 +0000 (08:55 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 14 Sep 2006 08:55:17 +0000 (08:55 +0000)
Zend/zend_alloc.c
Zend/zend_alloc.h

index 840387548cb5029a700edd5e7542d4e2f8013681..ca8aab1a266a954ed657867f155a4916a98814f0 100644 (file)
@@ -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();
index 842a6e552d5b9a3e75f6591fe198c4f2ea035985..1befb7475cb3e7e5313c51acb12822ef3d8ff61c 100644 (file)
@@ -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);