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 @@ -4369,7 +4369,7 @@ static void preload_load(size_t orig_map_ptr_static_last)
4369
4369
zend_map_ptr_static_last = ZCSG (map_ptr_static_last );
4370
4370
4371
4371
/* Grow map_ptr table as needed, but allocate once for static + regular map_ptrs */
4372
- size_t new_static_size = (( zend_map_ptr_static_last - 1 ) & 4095 ) + 1 ;
4372
+ size_t new_static_size = ZEND_MM_ALIGNED_SIZE_EX ( zend_map_ptr_static_last , 4096 ) ;
4373
4373
if (zend_map_ptr_static_size != new_static_size ) {
4374
4374
void * new_base = pemalloc ((new_static_size + CG (map_ptr_size )) * sizeof (void * ), 1 );
4375
4375
if (CG (map_ptr_real_base )) {
@@ -4394,7 +4394,8 @@ static void preload_load(size_t orig_map_ptr_static_last)
4394
4394
ZCG (preloaded_internal_run_time_cache ) = cache ;
4395
4395
4396
4396
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 ) {
4397
- void * * ptr = (void * * ) CG (map_ptr_real_base ) + zend_map_ptr_static_size - ((cur_static_map_ptr & ~4095 ) + 4096 ) + (cur_static_map_ptr & 4095 );
4397
+ // Note: chunked like: [8192..12287][4096..8191][0..4095]
4398
+ void * * ptr = (void * * ) CG (map_ptr_real_base ) + zend_map_ptr_static_size - ZEND_MM_ALIGNED_SIZE_EX (cur_static_map_ptr + 1 , 4096 ) + (cur_static_map_ptr & 4095 );
4398
4399
* ptr = cache ;
4399
4400
cache += runtime_cache_size ;
4400
4401
}
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