Skip to content

Commit dc02e68

Browse files
committed
Try to fix ZTS build
1 parent d2110e9 commit dc02e68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Zend/zend.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,10 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals) /* {{
655655
compiler_globals->map_ptr_last = global_map_ptr_last;
656656
if (compiler_globals->map_ptr_last) {
657657
/* Allocate map_ptr table */
658+
void *base;
658659
compiler_globals->map_ptr_size = ZEND_MM_ALIGNED_SIZE_EX(compiler_globals->map_ptr_last, 4096);
659660
base = pemalloc(compiler_globals->map_ptr_size * sizeof(void*), 1);
660-
ZEND_MAP_PTR_SET_BASE(base);
661+
ZEND_MAP_PTR_SET_REAL_BASE(compiler_globals->map_ptr_base, base);
661662
memset(base, 0, compiler_globals->map_ptr_last * sizeof(void*));
662663
}
663664
#else
@@ -914,7 +915,7 @@ int zend_startup(zend_utility_functions *utility_functions) /* {{{ */
914915
*/
915916
CG(map_ptr_size) = 1024 * 1024; // TODO: initial size ???
916917
CG(map_ptr_last) = 0;
917-
ZEND_MAP_PTR_SET_BASE(pemalloc(CG(map_ptr_size) * sizeof(void*), 1));
918+
ZEND_MAP_PTR_SET_REAL_BASE(CG(map_ptr_base), pemalloc(CG(map_ptr_size) * sizeof(void*), 1));
918919
# elif ZEND_MAP_PTR_KIND == ZEND_MAP_PTR_KIND_PTR_OR_OFFSET
919920
/* Map region is going to be created and resized at run-time. */
920921
ZEND_MAP_PTR_SET_REAL_BASE(CG(map_ptr_base), NULL);

0 commit comments

Comments
 (0)