File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -4364,7 +4364,7 @@ static void preload_load(size_t orig_map_ptr_static_last)
4364
4364
zend_map_ptr_static_last = ZCSG (map_ptr_static_last );
4365
4365
4366
4366
/* Grow map_ptr table as needed, but allocate once for static + regular map_ptrs */
4367
- size_t new_static_size = (( zend_map_ptr_static_last - 1 ) & 4095 ) + 1 ;
4367
+ size_t new_static_size = ZEND_MM_ALIGNED_SIZE_EX ( zend_map_ptr_static_last , 4096 ) ;
4368
4368
if (zend_map_ptr_static_size != new_static_size ) {
4369
4369
void * new_base = pemalloc ((new_static_size + CG (map_ptr_size )) * sizeof (void * ), 1 );
4370
4370
if (CG (map_ptr_real_base )) {
@@ -4389,7 +4389,8 @@ static void preload_load(size_t orig_map_ptr_static_last)
4389
4389
ZCG (preloaded_internal_run_time_cache ) = cache ;
4390
4390
4391
4391
for (size_t cur_static_map_ptr = orig_map_ptr_static_last ; cur_static_map_ptr < zend_map_ptr_static_last ; ++ cur_static_map_ptr ) {
4392
- void * * ptr = (void * * ) CG (map_ptr_real_base ) + zend_map_ptr_static_size - ((cur_static_map_ptr & ~4095 ) + 4096 ) + (cur_static_map_ptr & 4095 );
4392
+ // Note: chunked like: [8192..12287][4096..8191][0..4095]
4393
+ void * * ptr = (void * * ) CG (map_ptr_real_base ) + zend_map_ptr_static_size - ZEND_MM_ALIGNED_SIZE_EX (cur_static_map_ptr , 4096 ) + (cur_static_map_ptr & 4095 );
4393
4394
* ptr = cache ;
4394
4395
cache += runtime_cache_size ;
4395
4396
}
Original file line number Diff line number Diff line change @@ -281,10 +281,10 @@ typedef struct _zend_accel_shared_globals {
281
281
void * jit_traces ;
282
282
const void * * jit_exit_groups ;
283
283
284
+ size_t map_ptr_static_last ;
285
+
284
286
/* Interned Strings Support (must be the last element) */
285
287
ZEND_SET_ALIGNED (ZEND_STRING_TABLE_POS_ALIGNMENT , zend_string_table interned_strings );
286
-
287
- size_t map_ptr_static_last ;
288
288
} zend_accel_shared_globals ;
289
289
290
290
#ifdef ZEND_WIN32
You can’t perform that action at this time.
0 commit comments