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

Add memory mangament feature #286

Closed
wants to merge 2 commits into from
Closed

Add memory mangament feature #286

wants to merge 2 commits into from

Conversation

NickNaso
Copy link
Member

Added MemoryManagement as class and AdjustExternalMemory function as static method.
For more info see the following issue: #260

For more info see the following issue: #260
Copy link
Contributor

@gabrielschulhof gabrielschulhof left a comment

Choose a reason for hiding this comment

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

LGTM with these minor changes.

### AdjustExternalMemory

The function `AdjustExternalMemory` adjusts the amount of registered external
memory. Used to give the JavaScript engine an indication of the amount of externally
Copy link
Contributor

Choose a reason for hiding this comment

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

"[It is ]Uused ..."

static int64_t MemoryManagement::AdjustExternalMemory(Env env, int64_t change_in_bytes);
```

- `[in] env`: The environment in which the API is inoked under.
Copy link
Contributor

Choose a reason for hiding this comment

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

"in[v]oked"

Object exports = Object::New(env);
exports["externalAllocatedMemory"] = Function::New(env, externalAllocatedMemory);
return exports;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a newline to the end of the file!


function test(binding) {
assert.strictEqual(binding.memory_management.externalAllocatedMemory(), true)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

mhdawson pushed a commit that referenced this pull request 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>
@mhdawson
Copy link
Member

mhdawson commented Jul 4, 2018

Landed as 605aa2b

@mhdawson mhdawson closed this Jul 4, 2018
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request 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 pull request 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 pull request 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>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants