Skip to content

Commit c9a5733

Browse files
committed
Set the MALLOC_ALIGNMENT to 16.
This isn't strictly required, as wasm SIMD loads and stores work on unaligned memory. However, it may provide better performance. That said, this isn't currently studied by any benchmarking.
1 parent c35f0f5 commit c9a5733

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

dlmalloc/src/dlmalloc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#define NO_MALLINFO 1
3030
#define NO_MALLOC_STATS 1
3131

32+
/* Align malloc regions to 16, to avoid unaligned SIMD accesses. */
33+
#define MALLOC_ALIGNMENT 16
34+
3235
/*
3336
* Declare errno values used by dlmalloc. We define them like this to avoid
3437
* putting specific errno values in the ABI.

0 commit comments

Comments
 (0)