Skip to content

Should AdjustExternalMemory take a BasicEnv? #1594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
audetto opened this issue Oct 20, 2024 · 1 comment · Fixed by #1597
Closed

Should AdjustExternalMemory take a BasicEnv? #1594

audetto opened this issue Oct 20, 2024 · 1 comment · Fixed by #1597

Comments

@audetto
Copy link

audetto commented Oct 20, 2024

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?

@audetto
Copy link
Author

audetto commented Oct 21, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant