Skip to content

Commit 96963bf

Browse files
committed
move zend_mm_munmap above zend_mm_mmap_fixed
1 parent 2c8f2e9 commit 96963bf

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Zend/zend_alloc.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,23 @@ stderr_last_error(char *msg)
415415
/* OS Allocation */
416416
/*****************/
417417

418+
static void zend_mm_munmap(void *addr, size_t size)
419+
{
420+
#ifdef _WIN32
421+
if (VirtualFree(addr, 0, MEM_RELEASE) == 0) {
422+
#if ZEND_MM_ERROR
423+
stderr_last_error("VirtualFree() failed");
424+
#endif
425+
}
426+
#else
427+
if (munmap(addr, size) != 0) {
428+
#if ZEND_MM_ERROR
429+
fprintf(stderr, "\nmunmap() failed: [%d] %s\n", errno, strerror(errno));
430+
#endif
431+
}
432+
#endif
433+
}
434+
418435
#ifndef HAVE_MREMAP
419436
static void *zend_mm_mmap_fixed(void *addr, size_t size)
420437
{
@@ -482,23 +499,6 @@ static void *zend_mm_mmap(size_t size)
482499
#endif
483500
}
484501

485-
static void zend_mm_munmap(void *addr, size_t size)
486-
{
487-
#ifdef _WIN32
488-
if (VirtualFree(addr, 0, MEM_RELEASE) == 0) {
489-
#if ZEND_MM_ERROR
490-
stderr_last_error("VirtualFree() failed");
491-
#endif
492-
}
493-
#else
494-
if (munmap(addr, size) != 0) {
495-
#if ZEND_MM_ERROR
496-
fprintf(stderr, "\nmunmap() failed: [%d] %s\n", errno, strerror(errno));
497-
#endif
498-
}
499-
#endif
500-
}
501-
502502
/***********/
503503
/* Bitmask */
504504
/***********/

0 commit comments

Comments
 (0)