Skip to content

externref without allocations/hashmap, handled by the host application #4795

@IndianBoy42

Description

@IndianBoy42

Is your feature request related to a problem? Please describe.
I want to use externref to pass some handles to/from the wasm module, theres going to be very few and all statically known. Keeping a std::array<void*> is more efficienct and predictable (memory allocation) than the current map approach that externref_obj2ref and ref2obj use

Describe the solution you'd like
Either module_inst_t or exec_env_t could contain function pointers for the ref2obj and obj2ref, the host application could override them to replace the builtin functions

Describe alternatives you've considered
Just passing uintptr_t directly, no mapping or indices. basically not using externref at all or only on the module side (is this compatible?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions