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

External memory management #270

Closed
wants to merge 11 commits into from
Closed

External memory management #270

wants to merge 11 commits into from

Conversation

NickNaso
Copy link
Member

Added utility function AdjustExternalMemory like discussed in the following issue:
#260
I added the function AdjustExternalMemory with corresponding tests and documentation. Please give a review of my work.

@mhdawson
Copy link
Member

Hope to find time to review tomorrow.

The **Error** class is a representation of the JavaScript Error object that is thrown
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be updated in this PR?

Error handling represents one of the most important considerations when
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file b e updated in this PR?

allocated memory that is kept alive by JavaScript objects.

```cpp
int64_t AdjustExternalMemory(napi_env env, int64_t change_in_bytes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the env parameter should probably be a node-addon-api Env as opposed to a napi_env.

@@ -0,0 +1,59 @@
# RangeError
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this file should be changed in this PR.

@mhdawson
Copy link
Member

Generally looks ok, except there are files that I don't think should be changed in this PR. Otherwise only a few small comments.

@NickNaso
Copy link
Member Author

NickNaso commented Jun 6, 2018

@mhdawson I changed the AdjustExternalMemory function as requested. I wrote the documentation for this function in file doc/memory_management. Could you take a look? After your revision I will provide to remove the wrong files on PR.

@@ -3074,6 +3074,17 @@ inline Value EscapableHandleScope::Escape(napi_value escapee) {
return Value(_env, result);
}

////////////////////////////////////////////////////////////////////////////////
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to add just a method as opposed to a class with methods. I think in earlier discussion it was either going to be a MemoryManagement class (or may Util class) with the method to adjust the memory.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was my misunderstanding. Now I will provide to create a class that expose the method. Sorry.

@mhdawson
Copy link
Member

This PR seems to change a lot of unrelated files. Can you fix up that up or open a new PR as an alternative?

@NickNaso
Copy link
Member Author

Hi @mhdawson please close this PR and later I will provide to open a new one.

@mhdawson
Copy link
Member

Closing and will look for new PR.

@mhdawson mhdawson closed this Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants