Unverified Commit f3682102 authored by Anna Henningsen's avatar Anna Henningsen
Browse files

src: give Http2Session JS fields their own backing store

It looks like it’s virtually impossible at this point to
create “fake” backing stores for objects that don’t fully
own their memory allocations, like the sub-field `js_fields_`
of `Http2Session`. In particular, it turns out that an
`ArrayBuffer` cannot always be easily separated from its
backing store in that situation through by detaching it.

This commit gives the JS-exposed parts of the class its own
memory allocation and its own backing store, simplifying the
code a bit and fixing flakiness coming from it, at the cost
of one additional layer of indirection when accessing the data.

Refs: https://github.com/nodejs/node/pull/30782
Fixes: https://github.com/nodejs/node/issues/31107

PR-URL: https://github.com/nodejs/node/pull/31648


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarDenys Otrishko <shishugi@gmail.com>
parent 3271c40a
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment