[PATCH] D44301: [WebAssembly] Add missing --demangle and --initial/max-memory args

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 10 08:09:45 PST 2018


ncw added a comment.

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.



================
Comment at: Common/Args.cpp:30
 
+unsigned lld::args::getInteger(opt::InputArgList &Args, unsigned Key,
+                               unsigned Default) {
----------------
sbc100 wrote:
> I would hope we don't need to add this.
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.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44301





More information about the llvm-commits mailing list