wasi-libc icon indicating copy to clipboard operation
wasi-libc copied to clipboard

Allocate the argv buffers with alloca instead of malloc.

Open sunfishcode opened this issue 5 years ago • 1 comments

This way, if an application doesn't otherwise use malloc, they don't need to link in malloc.

Idea from https://github.com/CraneStation/wasi-libc/pull/118#discussion_r337596386!

One thing I'm somewhat concerned by is the lack of error reporting in alloca. Perhaps that's a broader problem that we'll want to address anyway?

sunfishcode avatar Oct 25 '19 05:10 sunfishcode

I am considering waiting until __stack_limit is available (patch here), followed by a way to check for stack overflow in clang, before enabling this.

sunfishcode avatar Nov 20 '19 23:11 sunfishcode