Closed
Description
I see a thread here: #9337 which suggests to do emscripten_builtin_malloc/free. I don't know where that is defined but managed to make use of it by doing
extern "C" {
void* emscripten_builtin_malloc(size_t);
void emscripten_builtin_free(void*);
}
void* malloc(size_t size) {
size += sizeof(MyHeader);
MyHeader* header = (MyHeader*)emscripten_builtin_malloc(size);
// do stuff
return header+1;
}
// similarly adjusts the pointer provided as appropriate.
There is no emscripten_builtin_realloc/calloc and it seems the dlXXXX functions have been made completely hidden. Can all the builtins be made available for override? I don't see any documentation on this subject.
Thanks
Metadata
Metadata
Assignees
Labels
No labels