We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61778f2 commit d6aabb2Copy full SHA for d6aabb2
test/core/test_mallinfo.c
@@ -11,16 +11,16 @@
11
#include <unistd.h>
12
#include <assert.h>
13
#include <malloc.h>
14
-#include <emscripten/em_asm.h>
+#include <emscripten/heap.h>
15
16
size_t getTotalMemory() {
17
- return (size_t)EM_ASM_PTR(return HEAP8.length);
+ return emscripten_get_heap_size();
18
}
19
20
size_t getFreeMemory() {
21
struct mallinfo i = mallinfo();
22
- uintptr_t totalMemory = getTotalMemory();
23
- uintptr_t dynamicTop = (uintptr_t)sbrk(0);
+ size_t totalMemory = getTotalMemory();
+ size_t dynamicTop = (size_t)sbrk(0);
24
return totalMemory - dynamicTop + i.fordblks;
25
26
0 commit comments