Skip to content

Should AdjustExternalMemory take a BasicEnv? #1594

Closed

Description

@audetto

The core api function takes a node_api_basic_env, see https://nodejs.org/api/n-api.html#napi_adjust_external_memory

While via this library it needs a full Env: https://github.com/nodejs/node-addon-api/blob/ae2c23e7460d91ab5b1844d04372f42801bfa48e/napi-inl.h#L6702C34-L6702C54

Should it be downgraded to a BasicEnv so it can be called in the new synchronous finalisers?

Activity

  1. audetto commented on Oct 21, 2024

    @audetto
    Author

    I guess the reason is that it is allowed to throw a node error if the call fails.

    One could convert that to a normal c++ exception which cannot be propagated to node... don't know.

  2. moved this from Need Triage to Has PR in Node-API Team Projecton Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions