mirror of
https://github.com/php/php-src.git
synced 2026-04-23 16:08:35 +02:00
Remove reundant address comparison in accel_remap_huge_pages
Closes GH-8830 MAP_FIXED guarantees mmap will return that exact address or fail so the address comparison is redundant. The return value of this function is unused but I kept it because it improves readability.
This commit is contained in:
@@ -2984,19 +2984,19 @@ static int accel_remap_huge_pages(void *start, size_t size, size_t real_size, co
|
||||
zend_error(E_WARNING,
|
||||
ACCELERATOR_PRODUCT_NAME " huge_code_pages: mmap(HUGETLB) failed: %s (%d)",
|
||||
strerror(errno), errno);
|
||||
return -1;
|
||||
return FAILURE;
|
||||
# endif
|
||||
}
|
||||
|
||||
// Given the MAP_FIXED flag the address can never diverge
|
||||
ZEND_ASSERT(ret == start);
|
||||
zend_mmap_set_name(start, size, "zend_huge_code_pages");
|
||||
memcpy(start, mem, real_size);
|
||||
mprotect(start, size, PROT_READ | PROT_EXEC);
|
||||
|
||||
if (ret == start) {
|
||||
memcpy(start, mem, real_size);
|
||||
mprotect(start, size, PROT_READ | PROT_EXEC);
|
||||
}
|
||||
munmap(mem, size);
|
||||
|
||||
return (ret == start) ? 0 : -1;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static void accel_move_code_to_huge_pages(void)
|
||||
|
||||
Reference in New Issue
Block a user