Skip to content

there is no emscripten_builtin_realloc #23080

Closed
@graph

Description

@graph

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions