MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / malloc

Function malloc

test/core/test_wrap_malloc.c:16–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14static int totalReallocs;
15
16void *malloc(size_t size) {
17 ++totalAllocs;
18 void *ptr = emscripten_builtin_malloc(size);
19 emscripten_console_logf("Allocated %zu bytes, got %p. %d pointers allocated total.", size, ptr, totalAllocs);
20 return ptr;
21}
22
23void *realloc(void* ptr, size_t size) {
24 ++totalReallocs;

Callers 15

mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
uses_stackFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70

Calls 1

emscripten_console_logfFunction · 0.85

Tested by

no test coverage detected