Closed
Description
Commit b472d78 introduced ALLOW_TABLE_GROWTH
, which is extremely useful when it comes to dynamic linking and JIT-compiling modules, e.g. #7082 (comment).
With the latest incoming revision, it seems that ALLOW_TABLE_GROWTH
requires a non-zero value in RESERVED_FUNCTION_POINTERS
. This seems counter-intuitive to me: Unlike in asm.js, we should have no need to reserve in advance a fixed array of function pointers.
Example:
$ cat demo.c
#include <stdio.h>
int main() { printf("Hello!\n"); return 0; }
$ emcc demo.c -s ALLOW_TABLE_GROWTH=1 -s RESERVED_FUNCTION_POINTERS=1 -o demo.js && node demo.js
Hello!
$ emcc demo.c -s ALLOW_TABLE_GROWTH=1 -s RESERVED_FUNCTION_POINTERS=0 -o demo.js && node demo.js
failed to asynchronously prepare wasm: LinkError: WebAssembly Instantiation: table import 21 has no maximum length, expected 10
[...]
$ emcc demo.c -s ALLOW_TABLE_GROWTH=1 -o demo.js && node demo.js
failed to asynchronously prepare wasm: LinkError: WebAssembly Instantiation: table import 21 has no maximum length, expected 10
[...]