Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Looks good to me!
General question: in the case of an optimized (for size) wasm binary, why not put everything into a single segment instead of a small handful?
I think you are right about the optimized builds. One thing I thought we might want to preserve is that data objects from the same section should be grouped together contiguously.. but I think we can probably do that while at the same time putting it all in a single segment.
Also, we have post-linking tools such as wasm-opt in binaryen which will actually split up the data segments into smaller ones if they contain runs of zeros. I'm not sure about doing this in the general case since its not clear to me we can rely on the memory we are passed being zero-initialized. In general wasm memory are zero intialized, but the embedding code and reuse/modify memory before wasm init time.