Fixed phpdbg build

This commit is contained in:
Dmitry Stogov 2015-05-14 16:47:22 +03:00
parent 8e9b4b5aa7
commit 0604df8a82
4 changed files with 10 additions and 7 deletions

View File

@ -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;

View File

@ -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);
/*

View File

@ -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);
}

View File

@ -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"