Skip to content

Conversation

@jamesdolan
Copy link

@jamesdolan jamesdolan commented Dec 31, 2025

the GUARD_BLOCKS feature that is enabled when NDEBUG is not specified can cause unaligned memory allocations. This was causing Emscripten debug builds to throw alignment faults when -sSAFE_HEAP=2, and causing Safari to leak large amounts of memory when safe heap was disabled.

this change simply fixes the guard block size logic to ensure the combined header+guard size is 16-byte aligned which I believe was the intention.

Also, I realize the leak claim sounds crazy, and if true is clearly a safari bug, but fixing alignment issue is still a good idea. Also here is a simple repro.

@CLAassistant
Copy link

CLAassistant commented Dec 31, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants