Skip to content

Memory Management #260

Closed
Closed

Description

@NickNaso

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.

Activity

  1. mhdawson commented on May 3, 2018

    @mhdawson
    Member

    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.

  2. NickNaso commented on May 10, 2018

    @NickNaso
    MemberAuthor

    @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?

  3. mhdawson commented on May 14, 2018

    @mhdawson
    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.

  4. NickNaso commented on May 14, 2018

    @NickNaso
    MemberAuthor

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

  5. added a commit that references this issue on Jul 4, 2018
  6. NickNaso commented on Jul 6, 2018

    @NickNaso
    MemberAuthor

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

  7. added a commit that references this issue on Aug 24, 2022
  8. added a commit that references this issue on Aug 26, 2022
  9. added a commit that references this issue on Sep 19, 2022
  10. added a commit that references this issue on Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions