Skip to content

Commit d2482b7

Browse files
authored
activate the use of __heap_base (#215)
1 parent 215adc8 commit d2482b7

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

dlmalloc/src/malloc.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4560,12 +4560,10 @@ static void* tmalloc_small(mstate m, size_t nb) {
45604560

45614561
#if !ONLY_MSPACES
45624562

4563-
#if 0 // Temporarily work around https://bugs.llvm.org/show_bug.cgi?id=43613
45644563
#if __wasilibc_unmodified_upstream // Forward declaration of try_init_allocator.
45654564
#else
45664565
static void try_init_allocator(void);
45674566
#endif
4568-
#endif
45694567

45704568
void* dlmalloc(size_t bytes) {
45714569
/*
@@ -4595,13 +4593,11 @@ void* dlmalloc(size_t bytes) {
45954593
ensure_initialization(); /* initialize in sys_alloc if not using locks */
45964594
#endif
45974595

4598-
#if 0 // Temporarily work around https://bugs.llvm.org/show_bug.cgi?id=43613
45994596
#if __wasilibc_unmodified_upstream // Try to initialize the allocator.
46004597
#else
46014598
if (!is_initialized(gm)) {
46024599
try_init_allocator();
46034600
}
4604-
#endif
46054601
#endif
46064602

46074603
if (!PREACTION(gm)) {
@@ -5213,8 +5209,7 @@ static void internal_inspect_all(mstate m,
52135209
}
52145210
#endif /* MALLOC_INSPECT_ALL */
52155211

5216-
#if 0 // Temporarily work around https://bugs.llvm.org/show_bug.cgi?id=43613
5217-
#ifdef __wasilibc_unmodified_upstream // Define a function that initializes the initial state of dlmalloc
5212+
#ifdef __wasilibc_unmodified_upstream // Define a function that initializes the initial state of dlmalloc.
52185213
#else
52195214
/* ------------------ Exported try_init_allocator -------------------- */
52205215

@@ -5249,7 +5244,6 @@ static void try_init_allocator(void) {
52495244
init_top(gm, (mchunkptr)base, initial_heap_size - TOP_FOOT_SIZE);
52505245
}
52515246
#endif
5252-
#endif
52535247

52545248
/* ------------------ Exported realloc, memalign, etc -------------------- */
52555249

expected/wasm32-wasi/undefined-symbols.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ __floatsitf
1010
__floatunsitf
1111
__getf2
1212
__gttf2
13+
__heap_base
1314
__letf2
1415
__lttf2
1516
__netf2

0 commit comments

Comments
 (0)