buffer: replace deprecated SetWeak usage
Old style SetWeak is now deprecated, and weakness now works like phantom references. This means we no longer have a reference to the object in the weak callback. We use a kInternalFields style weak callback which provides us with the contents of 2 internal fields where we can squirrel away the native buffer pointer. We can no longer neuter the buffer in the weak callback, but that should be unnecessary as the object is going to be GC'd during the current gc cycle. PR-URL: https://github.com/nodejs/node/pull/5204 Reviewed-By:bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By:
indutny - Fedor Indutny <fedor.indutny@gmail.com>
parent
34aac23d
Please register or sign in to comment