From d6aabb2849021369f4abddd3cb21f5776b42242c Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 9 Jan 2025 11:17:46 -0800 Subject: [PATCH] [test] Avoid EM_ASM in test_mallinfo. NFC (#23346) --- test/core/test_mallinfo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/core/test_mallinfo.c b/test/core/test_mallinfo.c index 7182bda2cde4a..08bf4c25b7434 100644 --- a/test/core/test_mallinfo.c +++ b/test/core/test_mallinfo.c @@ -11,16 +11,16 @@ #include #include #include -#include +#include size_t getTotalMemory() { - return (size_t)EM_ASM_PTR(return HEAP8.length); + return emscripten_get_heap_size(); } size_t getFreeMemory() { struct mallinfo i = mallinfo(); - uintptr_t totalMemory = getTotalMemory(); - uintptr_t dynamicTop = (uintptr_t)sbrk(0); + size_t totalMemory = getTotalMemory(); + size_t dynamicTop = (size_t)sbrk(0); return totalMemory - dynamicTop + i.fordblks; }