Skip to content
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

[perf] WebAssembly.Memory is not resizable ArrayBuffer. #56801

Closed
loynoir opened this issue Jan 28, 2025 · 2 comments
Closed

[perf] WebAssembly.Memory is not resizable ArrayBuffer. #56801

loynoir opened this issue Jan 28, 2025 · 2 comments
Labels
wasm Issues and PRs related to WebAssembly.

Comments

@loynoir
Copy link

loynoir commented Jan 28, 2025

Version

v23.4.0

Platform

docker archlinux latest

Subsystem

No response

What steps will reproduce the bug?

Not sure if it is a bug or not, WebAssembly.Memory is not resizable ArrayBuffer.

Did not benchmark, maybe related to perf.

https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Memory

The WebAssembly.Memory object is a resizable ArrayBuffer or SharedArrayBuffer that holds raw bytes of memory accessed by a WebAssembly.Instance.

rustwasm/wasm-bindgen#4416

> mod.__wasm.memory.buffer.resizable
false
> mod.__wasm.memory.buffer.byteLength 
1114112
> void (ab0 = mod.__wasm.memory.buffer)
undefined
> void mod.hello()
undefined
> mod.__wasm.memory.buffer.byteLength 
1179648
> void (ab1 = mod.__wasm.memory.buffer)
undefined
> ab1 === ab0
false
> memory.buffer.resize(memory.buffer.byteLength+65536)
Uncaught:
TypeError: Method ArrayBuffer.prototype.resize called on incompatible receiver #<ArrayBuffer>
    at ArrayBuffer.resize (<anonymous>)

How often does it reproduce? Is there a required condition?

No.

What is the expected behavior? Why is that the expected behavior?

WebAssembly.Memory is resizable ArrayBuffer.

What do you see instead?

WebAssembly.Memory is not resizable ArrayBuffer.

Additional information

No response

@legendecas
Copy link
Member

This should be tracked in V8 issue tracker: https://issues.chromium.org/issues/42202693

@legendecas legendecas added the wasm Issues and PRs related to WebAssembly. label Jan 28, 2025
@legendecas
Copy link
Member

No actions in node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasm Issues and PRs related to WebAssembly.
Projects
None yet
Development

No branches or pull requests

2 participants