php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #79027
Patch accel_get_hugepage_size revision 2019-12-31 13:32 UTC by chris at neadwerx dot com
Patch PHP7_huge_2mb_flag.patch revision 2019-12-31 12:37 UTC by chris at neadwerx dot com

Patch PHP7_huge_2mb_flag.patch for opcache Bug #79027

Patch version 2019-12-31 12:37 UTC

Return to Bug #79027 | Download this patch
Patch Revisions:

Developer: chris@neadwerx.com

diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 52276010af..1015603066 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2638,7 +2638,11 @@ static int accel_remap_huge_pages(void *start, size_t size, const char *name, si
 #  ifdef MAP_HUGETLB
        ret = mmap(start, size,
                PROT_READ | PROT_WRITE | PROT_EXEC,
-               MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED | MAP_HUGETLB,
+               MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED | MAP_HUGETLB
+#  ifdef MAP_HUGE_2MB
+        | MAP_HUGE_2MB
+#  endif
+        ,
                -1, 0);
 #  endif
        if (ret == MAP_FAILED) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 03:01:28 2024 UTC