Skip to content

Commit bca1425

Browse files
committed
zend_alloc: Fix compilation with ZEND_MM_CUSTOM=0
The poison feature relies on ZEND_MM_CUSTOM=1. If ZEND_MM_CUSTOM=0, the build fails. To fix this, move some `#endif`.
1 parent 4f0554f commit bca1425

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,7 +2400,6 @@ static void zend_mm_check_leaks(zend_mm_heap *heap)
24002400
static void *tracked_malloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
24012401
static void tracked_free_all(zend_mm_heap *heap);
24022402
static void *poison_malloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
2403-
#endif
24042403

24052404
static void zend_mm_check_freelists(zend_mm_heap *heap)
24062405
{
@@ -2411,6 +2410,7 @@ static void zend_mm_check_freelists(zend_mm_heap *heap)
24112410
}
24122411
}
24132412
}
2413+
#endif
24142414

24152415
ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, bool full, bool silent)
24162416
{
@@ -3041,7 +3041,6 @@ static void tracked_free_all(zend_mm_heap *heap) {
30413041
free(ptr);
30423042
} ZEND_HASH_FOREACH_END();
30433043
}
3044-
#endif
30453044

30463045
static void* poison_malloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
30473046
{
@@ -3236,6 +3235,7 @@ static void poison_enable(zend_mm_heap *heap, char *parameters)
32363235
zend_mm_set_custom_handlers_ex(heap, poison_malloc, poison_free,
32373236
poison_realloc, poison_gc, poison_shutdown);
32383237
}
3238+
#endif
32393239

32403240
static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
32413241
{

0 commit comments

Comments
 (0)