WebAssembly memories are zero-initialized, so when module does not
import its memory initializing .bss sections is guaranteed to be a
no-op. To reduce binary size and initialization time, .bss sections
are simply not emitted into the final binary unless the memory is
imported.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Great!
lld/wasm/OutputSections.cpp | ||
---|---|---|
219 | You find this easier to read than: for (auto S : segments) if (!seg->isImplicit) return true; return false; ? Maybe I just need get of board with the kids and accept the C++ lambda future that we now live in? I mean it is kinda cool. Is there something like python's any() builtin in stl that might make this more readable? |
lld/wasm/OutputSections.cpp | ||
---|---|---|
219 | Yeah, in lld the for loops such as the one Sam suggested are used more often than the higher-order predicate function. Rewriting this with for is perhaps more preferable. | |
lld/wasm/OutputSegment.h | ||
35 | isBss is I think more straightforward name, and I believe we use that variable name in ELF too. |
You find this easier to read than:
?
Maybe I just need get of board with the kids and accept the C++ lambda future that we now live in? I mean it is kinda cool.
Is there something like python's any() builtin in stl that might make this more readable?