-
Notifications
You must be signed in to change notification settings - Fork 202
Open
Milestone
Description
TL;DR
We plan to implement Immutable ArrayBuffers in GraalJS.
Details
This proposal enables buffers to be immutable and adds to ArrayBuffer.prototype one read-only accessor
immutable: boolean
-- is this buffer immutable, or can its contents be changed?
and two methods
transferToImmutable(newByteLength?: number): ArrayBuffer
-- move the contents of the original buffer into a new immutable buffer, detach the original buffer, and return the new buffer.sliceToImmutable(start?: number, end?: number): ArrayBuffer
-- create a new immutable buffer from a range of the original buffer's contents in a way that allows implementations to easily minimize and sometimes even eliminate copying them.
An immutable buffer cannot be detached, resized, or further transferred. Its maxByteLength is the same as its byteLength. A DataView or TypedArray using an immutable buffer as its backing store can be frozen and immutable.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Todo