-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host reject to freeze? #20
Comments
I'm confused, how would this not work out of the box? If it's actually a proper instance of ArrayBuffer, then it'd be detachable; if it's not detachable, then it's not a proper instance of ArrayBuffer. |
I mean, if there is a case that the host wants to reject the AB being detachable. this is like |
Why would we want to consider a host hook when no use case for that has presented itself? |
Host buffers can already be non-detachable/transferable via const mem = new WebAssembly.Memory({ initial: 1 });
// Throws a TypeError
const newBuffer = mem.buffer.transfer();
const oldBuffer = mem.buffer;
mem.grow(1);
// Now detached
oldBuffer.detached; // true
oldBuffer === mem.buffer; // false
const mem = new WebAssembly.Memory({ initial: 1, maximum: 1 });
// Not detachable by any means
mem.buffer; I don't see that this proposal needs anything special, if a host buffer can't be transfered to an immutable buffer then they can just set |
Thank you! This is first time I learn |
It might be possible there is a host API like this:
Is this a case we want the host to be able to reject the detached behavior? (This also affects other APIs like
transfer
actually).The text was updated successfully, but these errors were encountered: