Skip to content
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

Memory Management #260

Closed
NickNaso opened this issue May 3, 2018 · 5 comments
Closed

Memory Management #260

NickNaso opened this issue May 3, 2018 · 5 comments

Comments

@NickNaso
Copy link
Member

NickNaso commented May 3, 2018

Hi everyone,
in my recent porting I had the need of using napi_adjust_external_memory See: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_memory_management . What do you think if we add this function to node-addon-api? if you are agree I want try to add the function with some guide.

@mhdawson
Copy link
Member

mhdawson commented May 3, 2018

Agreed. Everything in the C n_api should be usable through node-addon-api, we just have not gotten them all in. Would be great if you add it in.

@NickNaso
Copy link
Member Author

@mhdawson @gabrielschulhof I'm starting on this. I want add a function on Napi namespace as reported below:

int64_t AdjustExternalMemory(napi_env env, int64_t change_in_bytes);

This is the same approach that I found on NAN.
I don't know if could be useful create a class called for example MemoryManagement and attach to it a method AdjustExternalMemory.
What is your thinking about that?

@mhdawson
Copy link
Member

It is an interesting question as we don't have any other Utility classes, and adding the method to any of the existing classes does not make sense to me.

At this point your suggestion seems like the best idea to me.

@NickNaso
Copy link
Member Author

@mhdawson Thanks for your opinion later I will provide to add it with corresponding tests and documentation.

mhdawson pushed a commit that referenced this issue Jul 4, 2018
Add memory mangament feature For more info see the following issue:
#260

PR-URL: #286
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
@NickNaso
Copy link
Member Author

NickNaso commented Jul 6, 2018

I close the issue because the PR with the feature was landed.

@NickNaso NickNaso closed this as completed Jul 6, 2018
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this issue Aug 24, 2022
Add memory mangament feature For more info see the following issue:
nodejs/node-addon-api#260

PR-URL: nodejs/node-addon-api#286
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this issue Aug 26, 2022
Add memory mangament feature For more info see the following issue:
nodejs/node-addon-api#260

PR-URL: nodejs/node-addon-api#286
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this issue Sep 19, 2022
Add memory mangament feature For more info see the following issue:
nodejs/node-addon-api#260

PR-URL: nodejs/node-addon-api#286
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
austinli64 added a commit to austinli64/node-addon-api that referenced this issue May 9, 2023
Add memory mangament feature For more info see the following issue:
nodejs/node-addon-api#260

PR-URL: nodejs/node-addon-api#286
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this issue Aug 11, 2023
Add memory mangament feature For more info see the following issue:
nodejs/node-addon-api#260

PR-URL: nodejs/node-addon-api#286
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants