Skip to content

n-api: does napi_create_external_buffer copy? #33471

Closed
@mafintosh

Description

@mafintosh

Hunting down a bug related to napi_create_external_buffer, I got a bit confused by reading the docs here:

https://nodejs.org/dist/latest-v14.x/docs/api/n-api.html#n_api_napi_create_external_buffer

[in] data: Raw pointer to the underlying buffer to copy from.

Does this mean that the buffer is created with the same pointer or a new pointer that's a memcopy?

Further down on the docs for the same method it also says:

This API allocates a node::Buffer object and initializes it with data backed by the passed in buffer.

Which I'm also not sure wheather to interpret as a memcopy

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.node-apiIssues and PRs related to the Node-API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions