]>
Commit | Line | Data |
---|---|---|
abe05a73 XL |
1 | #include <stdio.h> |
2 | #include <stdlib.h> | |
3 | #include <emscripten.h> | |
4 | ||
5 | volatile int writeOnly; | |
6 | ||
7 | int main() { | |
8 | EM_ASM({ | |
9 | assert(HEAPU8.length === 16*1024*1024); | |
10 | }); | |
11 | for (int i = 0; i < 20; i++) { | |
12 | printf("alloc 1MB: %d\n", i); | |
13 | writeOnly = (int)malloc(1024*1024); | |
14 | } | |
15 | EM_ASM({ | |
16 | assert(HEAPU8.length > 16*1024*1024); | |
17 | }); | |
18 | printf("ok.\n"); | |
19 | } | |
20 |