mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fixed windows build (Rob)
This commit is contained in:
parent
fb7306822d
commit
c3c5d27fbc
@ -403,9 +403,9 @@ typedef struct _zend_mm_free_block {
|
||||
|
||||
struct _zend_mm_heap {
|
||||
int use_zend_alloc;
|
||||
void *(*malloc)(size_t);
|
||||
void (*free)(void*);
|
||||
void *(*realloc)(void*, size_t);
|
||||
void *(*_malloc)(size_t);
|
||||
void (*_free)(void*);
|
||||
void *(*_realloc)(void*, size_t);
|
||||
size_t free_bitmap;
|
||||
size_t large_free_bitmap;
|
||||
size_t block_size;
|
||||
@ -2267,7 +2267,7 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (UNEXPECTED(!AG(mm_heap)->use_zend_alloc)) {
|
||||
return AG(mm_heap)->malloc(size);
|
||||
return AG(mm_heap)->_malloc(size);
|
||||
}
|
||||
return _zend_mm_alloc_int(AG(mm_heap), size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
@ -2277,7 +2277,7 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (UNEXPECTED(!AG(mm_heap)->use_zend_alloc)) {
|
||||
AG(mm_heap)->free(ptr);
|
||||
AG(mm_heap)->_free(ptr);
|
||||
return;
|
||||
}
|
||||
_zend_mm_free_int(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
@ -2288,7 +2288,7 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (UNEXPECTED(!AG(mm_heap)->use_zend_alloc)) {
|
||||
return AG(mm_heap)->realloc(ptr, size);
|
||||
return AG(mm_heap)->_realloc(ptr, size);
|
||||
}
|
||||
return _zend_mm_realloc_int(AG(mm_heap), ptr, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
@ -2456,9 +2456,9 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals TSRMLS_DC)
|
||||
if (tmp) {
|
||||
alloc_globals->mm_heap->use_zend_alloc = zend_atoi(tmp, 0);
|
||||
if (!alloc_globals->mm_heap->use_zend_alloc) {
|
||||
alloc_globals->mm_heap->malloc = malloc;
|
||||
alloc_globals->mm_heap->free = free;
|
||||
alloc_globals->mm_heap->realloc = realloc;
|
||||
alloc_globals->mm_heap->_malloc = malloc;
|
||||
alloc_globals->mm_heap->_free = free;
|
||||
alloc_globals->mm_heap->_realloc = realloc;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2494,14 +2494,14 @@ ZEND_API zend_mm_storage *zend_mm_get_storage(zend_mm_heap *heap)
|
||||
}
|
||||
|
||||
ZEND_API void zend_mm_set_custom_handlers(zend_mm_heap *heap,
|
||||
void* (*malloc)(size_t),
|
||||
void (*free)(void*),
|
||||
void* (realloc)(void*, size_t))
|
||||
void* (*_malloc)(size_t),
|
||||
void (*_free)(void*),
|
||||
void* (*_realloc)(void*, size_t))
|
||||
{
|
||||
heap->use_zend_alloc = 0;
|
||||
heap->malloc = malloc;
|
||||
heap->free = free;
|
||||
heap->realloc = realloc;
|
||||
heap->_malloc = _malloc;
|
||||
heap->_free = _free;
|
||||
heap->_realloc = _realloc;
|
||||
}
|
||||
|
||||
#if ZEND_DEBUG
|
||||
|
@ -234,9 +234,9 @@ ZEND_API zend_mm_heap *zend_mm_set_heap(zend_mm_heap *new_heap TSRMLS_DC);
|
||||
ZEND_API zend_mm_storage *zend_mm_get_storage(zend_mm_heap *heap);
|
||||
|
||||
ZEND_API void zend_mm_set_custom_handlers(zend_mm_heap *heap,
|
||||
void* (*malloc)(size_t),
|
||||
void (*free)(void*),
|
||||
void* (realloc)(void*, size_t));
|
||||
void* (*_malloc)(size_t),
|
||||
void (*_free)(void*),
|
||||
void* (*_realloc)(void*, size_t));
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user