From: Christoph M. Becker Date: Sat, 24 Sep 2016 16:05:21 +0000 (+0200) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.0.12RC1~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc22582cf7c8782a75e24395af23170d2c4400a7;p=php Merge branch 'PHP-5.6' into PHP-7.0 --- bc22582cf7c8782a75e24395af23170d2c4400a7 diff --cc Zend/zend_alloc.c index a79d67b4b9,c7babe12b7..8861d00874 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@@ -2643,23 -2732,15 +2643,23 @@@ static void alloc_globals_ctor(zend_all char *tmp = getenv("USE_ZEND_ALLOC"); if (tmp && !zend_atoi(tmp, 0)) { - alloc_globals->mm_heap = malloc(sizeof(struct _zend_mm_heap)); - memset(alloc_globals->mm_heap, 0, sizeof(struct _zend_mm_heap)); - alloc_globals->mm_heap->use_zend_alloc = 0; - alloc_globals->mm_heap->_malloc = __zend_malloc; - alloc_globals->mm_heap->_free = free; - alloc_globals->mm_heap->_realloc = __zend_realloc; - } else { - alloc_globals->mm_heap = zend_mm_startup(); + alloc_globals->mm_heap = malloc(sizeof(zend_mm_heap)); + memset(alloc_globals->mm_heap, 0, sizeof(zend_mm_heap)); + alloc_globals->mm_heap->use_custom_heap = ZEND_MM_CUSTOM_HEAP_STD; - alloc_globals->mm_heap->custom_heap.std._malloc = malloc; ++ alloc_globals->mm_heap->custom_heap.std._malloc = __zend_malloc; + alloc_globals->mm_heap->custom_heap.std._free = free; - alloc_globals->mm_heap->custom_heap.std._realloc = realloc; ++ alloc_globals->mm_heap->custom_heap.std._realloc = __zend_realloc; + return; } +#endif +#ifdef MAP_HUGETLB + tmp = getenv("USE_ZEND_ALLOC_HUGE_PAGES"); + if (tmp && zend_atoi(tmp, 0)) { + zend_mm_use_huge_pages = 1; + } +#endif + ZEND_TSRMLS_CACHE_UPDATE(); + alloc_globals->mm_heap = zend_mm_init(); } #ifdef ZTS