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

Function uses_stack

test/core/test_ccall.cpp:42–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40__attribute__((noinline))
41intptr_t get_stack() { int i; return (intptr_t)&i; }
42int uses_stack(test_struct* t1) {
43 if (stackChecker == 0) stackChecker = (intptr_t*)malloc(sizeof(intptr_t));
44 *stackChecker = get_stack();
45 EM_ASM(Module['ccall']('get_int', 'number'));
46 printf("stack is %s.\n", *stackChecker == get_stack() ? "ok" : "messed up");
47 return 0;
48}
49void call_ccall_again() {
50 test_struct t1 = { 1, 2, 3 };
51 uses_stack(&t1);

Callers 1

call_ccall_againFunction · 0.85

Calls 4

get_stackFunction · 0.85
printfFunction · 0.85
mallocFunction · 0.70
EM_ASMFunction · 0.50

Tested by

no test coverage detected