← Back to release summary

Resizable ArrayBuffer and growable SharedArrayBuffer

Category
JavaScript
Type
Chromium catches up
Status
Enabled by default (Chrome 111)
Intent stage
Dev trials

Summary

Extend the ArrayBuffer constructors to take an additional maximum length that allows in-place growth and shrinking of buffers. Similarly, SharedArrayBuffer is extended to take an additional maximum length that allows in-place growth.

Motivation

Allowing ArrayBuffers and SharedArrayBuffers to resize and grow allow for more efficient use, as currently resizing them requires copying. Additionally, WebAssembly linear memory can already resize, and this brings the same capability to JS.

Standards & signals

Explainers: https://github.com/tc39/proposal-resizablearraybuffer/blob/master/README.md

View on chromestatus.com