From: Dmitry Stogov Date: Thu, 14 May 2015 13:47:22 +0000 (+0300) Subject: Fixed phpdbg build X-Git-Tag: PRE_PHP7_NSAPI_REMOVAL~42^2~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0604df8a82084f2b7d4a46baf28edefa764c1dd2;p=php Fixed phpdbg build --- diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 108575fcbb..8f88368bc3 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -2499,7 +2499,7 @@ ZEND_API zend_mm_heap *zend_mm_startup(void) return zend_mm_init(); } -ZEND_API zend_mm_heap *zend_mm_startup_ex(zend_mm_handlers *handlers, void *data, size_t data_size) +ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void *data, size_t data_size) { #if ZEND_MM_STORAGE zend_mm_storage tmp_storage, *storage; diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index c41568519c..f76494e0d4 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -310,7 +310,7 @@ struct _zend_mm_storage { }; ZEND_API zend_mm_storage *zend_mm_get_storage(zend_mm_heap *heap); -ZEND_API zend_mm_heap *zend_mm_startup_ex(zend_mm_handlers *handlers, void *data, size_t data_size); +ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void *data, size_t data_size); /* diff --git a/sapi/phpdbg/phpdbg_sigsafe.c b/sapi/phpdbg/phpdbg_sigsafe.c index ce321595b1..319c9a5e75 100644 --- a/sapi/phpdbg/phpdbg_sigsafe.c +++ b/sapi/phpdbg/phpdbg_sigsafe.c @@ -29,13 +29,17 @@ static void zend_mm_mem_free(zend_mm_storage *storage, void *ptr, size_t size) { void phpdbg_set_sigsafe_mem(char *buffer) { phpdbg_signal_safe_mem *mem = &PHPDBG_G(sigsafe_mem); + const zend_mm_handlers phpdbg_handlers = { + zend_mm_mem_alloc, + zend_mm_mem_free, + NULL, + NULL, + }; + mem->mem = buffer; mem->allocated = 0; - mem->storage.chunk_alloc = zend_mm_mem_alloc; - mem->storage.chunk_free = zend_mm_mem_free; - - mem->heap = zend_mm_startup_ex(&mem->storage); + mem->heap = zend_mm_startup_ex(&phpdbg_handlers, NULL, 0); mem->old_heap = zend_mm_set_heap(mem->heap); } diff --git a/sapi/phpdbg/phpdbg_sigsafe.h b/sapi/phpdbg/phpdbg_sigsafe.h index d8a195f266..e5d0f34b43 100644 --- a/sapi/phpdbg/phpdbg_sigsafe.h +++ b/sapi/phpdbg/phpdbg_sigsafe.h @@ -13,7 +13,6 @@ typedef struct { zend_bool allocated; zend_mm_heap *heap; zend_mm_heap *old_heap; - zend_mm_storage storage; } phpdbg_signal_safe_mem; #include "phpdbg.h"