← All repos

proposal-resizablearraybuffer

Proposal for resizable array buffers

Browse cluster: WebAssembly Specification and Proposals
125commits
11contributors
1languages

Tech stack & purpose

This proposal extends JavaScript's `ArrayBuffer` and `SharedArrayBuffer` constructors to support in-place resizing, addressing inefficiencies in memory management and enabling better interoperability with WebAssembly memory growth and WebGPU buffer management. The proposal, authored and championed by Shu-yu Guo, introduces a `resize()` method for `ArrayBuffer` (which can grow and shrink) and a `grow()` method for `SharedArrayBuffer` (which can only grow), along with modifications to TypedArray constructors to automatically track buffer length when appropriate. The design prioritizes in-place implementation to avoid data pointer movement and includes security mitigations by keeping resizable buffers as an opt-in feature with distinct internal representations, separate from existing fixed-length buffer code paths.

Languages

HTML
100.0%

Contributors