Previously, Config->Demangle was not only not hooked up to commandline handling, but was uninitialised
Details
Diff Detail
- Repository
- rLLD LLVM Linker
Event Timeline
I think perhaps we should just drop the max-memory flag completely? At least until we know they its needed. emscripten doesn't need it and nor does the wasm waterfall.
Common/Args.cpp | ||
---|---|---|
30 ↗ | (On Diff #137739) | I would hope we don't need to add this. |
wasm/Writer.cpp | ||
120 ↗ | (On Diff #137739) | I'm OK with 0 meaning no max. Especially if i means you can avoid adding an duplicate getInteger helper for options? TBH, I'm torn about weather to just remove this option though. Do you know of any users who what to set a max? |
618 ↗ | (On Diff #137739) | Should probably error out if InitialMemory is not enough, rather than just making it bigger. Also, should we have have these value specific in page size? If not we should error out if user specified a non-aligned value (like we do for StackSize). |
Please split it into two patches, one for --demangle and the other for --initial/max-memory.
OK, I'll split this in two, and fix the nits regarding 0 for unset and forcing aligned values.
I think it is worth keeping MaxMemory and InitialMemory, even though they have limited use-cases. It's a memory-sanity feature, to ask the browser to keep a lid on your memory usage (based on what you know your code should be using), rather than letting bugs and leaks chew up RAM until it's exhausted. I think people probably should use it as a matter of course, to avoid reports of spiralling memory usage from users of their Wasm library! Maybe no-one will bother using it though.
Common/Args.cpp | ||
---|---|---|
30 ↗ | (On Diff #137739) | It's there to prevent people entering a negative number. Is that right, to have an unsigned variant? I mean we could parse it as a signed int, but then we'd have to add error-checking code to handle negative values, whereas punting that problem to llvm::to_integer seems simpler. |
wasm/Writer.cpp | ||
---|---|---|
120 ↗ | (On Diff #137739) | Oh - a further thought on zero. I remember now why I didn't do that, it's because for both Initial and Max is it possible to have zero as a legal value? Can a module not use the memory at all? I'm not sure we currently support it, but one day we might do. Zero does have a real "semantic" meaning for maximum, which is the opposite of "no maximum", whereas UINT32_MAX has a "semantic" meaning that exactly matches "no maximum". |