| 19 | } |
| 20 | |
| 21 | void 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 | |
| 37 | int main() { |
| 38 | recurse(1000*1000); |