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

[v12.x] src: use symbol to store AsyncWrap resource #33962

Closed
wants to merge 2 commits into from

Commits on Jun 19, 2020

  1. src: use symbol to store AsyncWrap resource

    Use a symbol on the bindings object to store the public resource object,
    rather than a `v8::Global` Persistent. This has several advantages:
    
    - It’s harder to inadvertently create memory leaks this way.
      The garbage collector sees the `AsyncWrap` →  resource link like
      a regular JS property, and can collect the objects as a group,
      even if the resource object should happen to point back to the
      `AsyncWrap` object.
    - This will make it easier in the future to use `owner_symbol` for
      this purpose, which is generally the direction we should be moving
      the `async_hooks` API into (i.e. using more public objects instead
      of letting internal wires stick out).
    
    PR-URL: nodejs#31745
    Reviewed-By: Stephen Belanger <[email protected]>
    Reviewed-By: David Carlier <[email protected]>
    Reviewed-By: Denys Otrishko <[email protected]>
    Reviewed-By: Chengzhong Wu <[email protected]>
    Reviewed-By: Benjamin Gruenbaum <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Minwoo Jung <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Franziska Hinkelmann <[email protected]>
    Reviewed-By: Gerhard Stöbich <[email protected]>
    addaleax committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    d2cb12a View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2020

  1. Configuration menu
    Copy the full SHA
    e5dcbd2 View commit details
    Browse the repository at this point in the history