This is an archive of the discontinued LLVM Phabricator instance.

[wasm-ld] Define a `__heap_end` symbol marking the end of allocated memory.
ClosedPublic

Authored by sunfish on Oct 17 2022, 1:56 PM.

Details

Summary

Define a __heap_end symbol that marks the end of the memory region
that starts at __heap_base. This will allow malloc implementations to
know how much memory they can use at __heap_base even if someone has
done a memory.grow before they can initialize their state.

Diff Detail

Event Timeline

sunfish created this revision.Oct 17 2022, 1:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 17 2022, 1:56 PM
Herald added subscribers: pmatos, asb. · View Herald Transcript
sunfish requested review of this revision.Oct 17 2022, 1:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 17 2022, 1:56 PM
Herald added a subscriber: aheejin. · View Herald Transcript

lgtm, with comment.

lld/wasm/Symbols.h
564

Can you maybe group these together under single comment? I started to do that above for stack_pointer/stack_low/__stack_high and I think it makes it easier to read this section of code. I noticed ELF was doing this in its Symbols.h

sunfish updated this revision to Diff 468361.Oct 17 2022, 4:24 PM
  • Merge the comments for heap_base and heap_end.
sunfish marked an inline comment as done.Oct 17 2022, 4:26 PM
sbc100 accepted this revision.Oct 17 2022, 4:31 PM
This revision is now accepted and ready to land.Oct 17 2022, 4:31 PM