]> 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:00:44 +0000 (08:00 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 14 Sep 2006 08:00:44 +0000 (08:00 +0000)
Zend/zend_alloc.c
Zend/zend_alloc.h

index d2bb14cb281ccdbf68011600c00d706b15f63fea..c1321757372cf3acc4f78b6a6133abe5468f7a5d 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 c8eecb99e90cbc0e046f372186057430c06c817b..70670d1f1717c6eb2fabeb4ac4853b8baa9842ed 100644 (file)
@@ -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);