Skip to content

Commit d95c538

Browse files
committed
Amendment to OPcache base file removal
We fix the erroneous segment size. We also keep the segment pointer at the allocated address, but increase the position instead.
1 parent 57ad5b3 commit d95c538

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ext/opcache/shared_alloc_win32.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,10 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
311311
} else {
312312
((void**)mapping_base)[0] = mapping_base;
313313
((void**)mapping_base)[1] = (void*)execute_ex;
314-
((char*)shared_segment->p) += ACCEL_BASE_POINTER_SIZE;
315314
}
316315

317-
shared_segment->pos = 0;
318-
shared_segment->size = requested_size;
316+
shared_segment->pos = ACCEL_BASE_POINTER_SIZE;
317+
shared_segment->size = requested_size - ACCEL_BASE_POINTER_SIZE;
319318

320319
zend_shared_alloc_unlock_win32();
321320

0 commit comments

Comments
 (0)