Skip to content

Commit 2907cb6

Browse files
committed
[GTK][WPE] Fix MALLOC_HEAP_BREAKDOWN build with system headers defining boolean_t
https://bugs.webkit.org/show_bug.cgi?id=300884 Reviewed by Michael Catanzaro. Remove useless boolean_t define and include stdbool.h instead. This define can conflict with another define of boolean_t, from a system header pulled by files using FastMalloc. Also add missing extern "C" block. * Source/WTF/wtf/malloc_heap_breakdown/main.cpp: (malloc_zone_print): * Source/WTF/wtf/malloc_heap_breakdown/malloc/malloc.h: Canonical link: https://commits.webkit.org/301861@main
1 parent bac2050 commit 2907cb6

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎Source/WTF/wtf/malloc_heap_breakdown/main.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,6 @@ size_t malloc_zone_pressure_relief(malloc_zone_t*, size_t)
296296
return 0;
297297
}
298298

299-
void malloc_zone_print(malloc_zone_t*, boolean_t)
299+
void malloc_zone_print(malloc_zone_t*, bool)
300300
{
301301
}

‎Source/WTF/wtf/malloc_heap_breakdown/malloc/malloc.h‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525

2626
#pragma once
2727

28+
#ifndef __cplusplus
29+
extern "C" {
30+
#endif
31+
32+
#include <stdbool.h>
2833
#include <stddef.h>
2934

3035
/* This file was inspired by malloc.h from MacOS. */
@@ -33,7 +38,6 @@ typedef struct _malloc_zone_t {
3338
} malloc_zone_t;
3439

3540
typedef size_t vm_size_t;
36-
typedef bool boolean_t;
3741

3842
/********* Creation and destruction ************/
3943

@@ -79,5 +83,9 @@ size_t malloc_zone_pressure_relief(malloc_zone_t *zone, size_t goal);
7983

8084
/********* Debug helpers ************/
8185

82-
extern void malloc_zone_print(malloc_zone_t *zone, boolean_t verbose);
86+
extern void malloc_zone_print(malloc_zone_t *zone, bool verbose);
8387
/* Prints summary on zone; if !zone, prints all zones */
88+
89+
#ifndef __cplusplus
90+
}
91+
#endif

0 commit comments

Comments
 (0)