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

buffer,n-api: properly handle Environment cleanup #30551

Closed
wants to merge 3 commits into from

Commits on Nov 29, 2019

  1. buffer: release buffers with free callbacks on env exit

    Invoke the free callback for a given `Buffer` if it was created
    with one, and mark the underlying `ArrayBuffer` as detached.
    
    This makes sure that the memory is released e.g. when addons inside
    Workers create such `Buffer`s.
    addaleax committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    3051b58 View commit details
    Browse the repository at this point in the history
  2. n-api: detach external ArrayBuffers on env exit

    Make sure that `ArrayBuffer`s created using
    `napi_create_external_arraybuffer` are rendered unusable
    after its memory has been released.
    addaleax committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    3bd4bbb View commit details
    Browse the repository at this point in the history
  3. test: port worker + buffer test to N-API

    This ports `test/addons/worker-buffer-callback` to N-API,
    with the small exception of using external `ArrayBuffer`s rather
    than external Node.js `Buffer`s.
    addaleax committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    e59af1b View commit details
    Browse the repository at this point in the history