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

Function recurse

test/core/stack_overflow.c:21–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void recurse(volatile unsigned long x) {
22 printf("recurse %ld sp=%#lx\n", x, emscripten_stack_get_current());
23 volatile unsigned long a = x;
24 volatile char buffer[1000*1000];
25 buffer[x/2] = 0;
26 buffer[(x-1)/2] = 0;
27 EM_ASM({});
28 if (x*x < x) {
29 act(&a);
30 if (a < x) x = a;
31 x--;
32 }
33 x += buffer[x/2];
34 if (x > 0) recurse(x-1);
35}
36
37int main() {
38 recurse(1000*1000);

Callers 2

actFunction · 0.85
mainFunction · 0.85

Calls 3

printfFunction · 0.85
actFunction · 0.85
EM_ASMFunction · 0.50

Tested by

no test coverage detected