[php-src] master: Merge branch 'PHP-8.5'
| From: | Arnaud Le Blanc | Date: | Fri, 04 Sep 2026 12:46:33 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.5' | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141065@lists.php.net to get a copy of this message | ||
Author: Arnaud Le Blanc (arnaud-lb)
Date: 2026-09-04T14:45:20+02:00
Commit: https://github.com/php/php-src/commit/b4b507e40b6fb582c5dd3957875da966986b13a9
Raw diff: https://github.com/php/php-src/commit/b4b507e40b6fb582c5dd3957875da966986b13a9.diff
Merge branch 'PHP-8.5'
* PHP-8.5:
ext/opcache: keep huge page remap inside the reserved range (#23554)
Changed paths:
M ext/opcache/shared_alloc_mmap.c
Diff:
diff --git a/ext/opcache/shared_alloc_mmap.c b/ext/opcache/shared_alloc_mmap.c
index a805912d0d75..4825da3e4c01 100644
--- a/ext/opcache/shared_alloc_mmap.c
+++ b/ext/opcache/shared_alloc_mmap.c
@@ -243,9 +243,9 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
/* to got HUGE PAGES in low 32-bit address we have to reserve address
space and then remap it using MAP_HUGETLB */
- p = mmap(NULL, requested_size, flags, MAP_SHARED|MAP_ANONYMOUS|MAP_32BIT, fd, 0);
+ p = mmap(NULL, requested_size + huge_page_size, flags, MAP_SHARED|MAP_ANONYMOUS|MAP_32BIT, fd,
0);
if (p != MAP_FAILED) {
- munmap(p, requested_size);
+ munmap(p, requested_size + huge_page_size);
p = (void*)(ZEND_MM_ALIGNED_SIZE_EX((ptrdiff_t)p, huge_page_size));
p = mmap(p, requested_size, flags, MAP_SHARED|MAP_ANONYMOUS|MAP_32BIT|MAP_HUGETLB|MAP_FIXED, -1,
0);
if (p != MAP_FAILED) {