alexcrichton opened issue #14812:
Right now the semantics of
map<K, V>mean that if duplicate keys are supplied then the last-specified key is the one present in the map. This is generally fine but this means that Wasmtime does not provide embedders the means to correctly operate with maps-of-handles because the embedder can't ever properly deallocate the handles it was given. For example if the host is given twoownhandles it'll only actually receive one of them, meaning the other effectively leaks.
alexcrichton added the wasm-proposal:component-model-map label to Issue #14812.
alexcrichton commented on issue #14812:
I've created an upstream issue to possibly close this by making
map<K, V>with handles an invalid component.
jrandolf commented on issue #14812:
I think the full issue isn't resolved, but the restriction has been added. Does this issue still block release of maps or can we say this issue is non-blocking now with the restriction? We can keep the issue open since it might be worth discussing later.
alexcrichton closed issue #14812:
Right now the semantics of
map<K, V>mean that if duplicate keys are supplied then the last-specified key is the one present in the map. This is generally fine but this means that Wasmtime does not provide embedders the means to correctly operate with maps-of-handles because the embedder can't ever properly deallocate the handles it was given. For example if the host is given twoownhandles it'll only actually receive one of them, meaning the other effectively leaks.
alexcrichton commented on issue #14812:
I'll close this since I believe with the upstream issue and wasmparser update this is a non-issue now.
Last updated: Nov 19 2026 at 20:05 UTC