Skip to content

Also good for web APIs #2

@bakkot

Description

@bakkot

Just pointing out another advantage: a number of web APIs take buffers, and because they need to worry about destructive writes, they are forced to copy the contents of the underlying buffer. Such APIs could be updated to check the immutable bit and skip the copy if so.

The same for userland APIs which take ArrayBuffers as well, of course, though I think they often simply tell consumers it's their responsibility not to mutate the buffer while the API is working rather than pessimistically copying.

(Some commentary on a different possible fix here.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions