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

Function TestStackValidity

test/core/test_stack_get_free.c:13–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13void TestStackValidity() {
14 uintptr_t base = emscripten_stack_get_base();
15 uintptr_t end = emscripten_stack_get_end();
16
17 uintptr_t used = labs((intptr_t)base - (intptr_t)emscripten_stack_get_current());
18 uintptr_t free = labs((intptr_t)end - (intptr_t)emscripten_stack_get_current());
19 uintptr_t free2 = emscripten_stack_get_free();
20 uintptr_t total = labs((intptr_t)end - (intptr_t)base);
21 assert(used + free == total);
22 assert(free == free2);
23}
24
25int increment = 256 * 1024;
26

Callers 1

mainFunction · 0.85

Calls 2

labsFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected