MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / check_memory_setting

Function check_memory_setting

tools/link.py:551–555  ·  view source on GitHub ↗
(setting)

Source from the content-addressed store, hash-verified

549 default_setting('INITIAL_MEMORY', 16 * 1024 * 1024)
550
551 def check_memory_setting(setting):
552 if settings[setting] % webassembly.WASM_PAGE_SIZE != 0:
553 exit_with_error(f'{setting} must be a multiple of WebAssembly page size (64KiB), was {settings[setting]}')
554 if settings[setting] >= 2**53:
555 exit_with_error(f'{setting} must be smaller than 2^53 bytes due to JS Numbers (doubles) being used to hold pointer addresses in JS side')
556
557 # Due to the aforementioned lack of knowledge about the static data size, we delegate
558 # checking the overall consistency of these settings to wasm-ld.

Callers 1

set_initial_memoryFunction · 0.85

Calls 1

exit_with_errorFunction · 0.85

Tested by

no test coverage detected