Fixed windows build (Rob)

This commit is contained in:
Dmitry Stogov 2007-11-06 12:06:05 +00:00
parent fb7306822d
commit c3c5d27fbc
2 changed files with 18 additions and 18 deletions

View File

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

View File

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