Skip to content

Commit 2bc5e14

Browse files
committed
Address review concerns
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
1 parent a39cdef commit 2bc5e14

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

Zend/zend_map_ptr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ typedef struct _zend_string zend_string;
7070
} while (0)
7171
# define ZEND_MAP_PTR_BIASED_BASE(real_base) \
7272
((void*)(((uintptr_t)(real_base)) + zend_map_ptr_static_size * sizeof(void *) - 1))
73-
// Note: chunked like: [8192..12287][4096..8191][0..4095]
73+
/* Note: chunked like: [8192..12287][4096..8191][0..4095] */
7474
#define ZEND_MAP_PTR_STATIC_NUM_TO_PTR(num) \
7575
((void **)CG(map_ptr_real_base) + zend_map_ptr_static_size - ZEND_MM_ALIGNED_SIZE_EX((num) + 1, 4096) + ((num) & 4095))
7676
#else

ext/opcache/ZendAccelerator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4379,7 +4379,7 @@ static void preload_load(size_t orig_map_ptr_static_last)
43794379
CG(map_ptr_real_base) = new_base;
43804380
zend_map_ptr_static_size = new_static_size;
43814381
} else {
4382-
CG(map_ptr_real_base) = perealloc(CG(map_ptr_real_base), CG(map_ptr_size) * sizeof(void *), 1);
4382+
CG(map_ptr_real_base) = perealloc(CG(map_ptr_real_base), (zend_map_ptr_static_size + CG(map_ptr_size)) * sizeof(void *), 1);
43834383
}
43844384

43854385
memset((void **) CG(map_ptr_real_base) + zend_map_ptr_static_size + old_map_ptr_last, 0, (CG(map_ptr_last) - old_map_ptr_last) * sizeof(void *));

ext/opcache/ZendAccelerator.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ typedef struct _zend_accel_shared_globals {
254254
zend_accel_hash hash; /* hash table for cached scripts */
255255

256256
size_t map_ptr_last;
257+
size_t map_ptr_static_last;
257258

258259
/* Directives & Maintenance */
259260
time_t start_time;
@@ -281,8 +282,6 @@ typedef struct _zend_accel_shared_globals {
281282
void *jit_traces;
282283
const void **jit_exit_groups;
283284

284-
size_t map_ptr_static_last;
285-
286285
/* Interned Strings Support (must be the last element) */
287286
ZEND_SET_ALIGNED(ZEND_STRING_TABLE_POS_ALIGNMENT, zend_string_table interned_strings);
288287
} zend_accel_shared_globals;

0 commit comments

Comments
 (0)