emscripten-core / emscripten-core/emscripten
How do I count the available webassembly memory size ?
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
`struct mallinfo2 {
int arena;
int ordblks;
int smblks;
int hblks;
int hblkhd;
int usmblks;
int fsmblks;
int uordblks;
int fordblks;
int keepcost;
};
unsigned int totalMemory = 1023*1024*1024;//EM_ASM_INT(return HEAP8.length);//1023*1024*1024;
unsigned int dynamicTop = (unsigned int)sbrk(0);
struct mallinfo2 mi;
mi = mallinfo2();
unsigned int freeMemory = totalMemory - dynamicTop + mi.fordblks;`
Free memory counted above seems to be the size of unallocated HEAP, but i want to get the size of total free memory size include unallocated and used and free memory
Contributor guide
Assessment
This issue has not been assessed yet.