Commit a5f3b3a6 authored by Anna Henningsen's avatar Anna Henningsen Committed by James M Snell
Browse files

src: add method to compute storage in WriteWrap

`WriteWrap` instances may contain extra storage space.
`self_size()` returns the size of the *entire* struct, member fields as
well as storage space, so it is not an accurate measure for the
storage space available.

Add a method `ExtraSize()` (like the existing `Extra()` for accessing
the storage memory) that yields the wanted value, and use it
in the HTTP2 impl to fix a crash.

PR-URL: https://github.com/nodejs/node/pull/16727
Refs: https://github.com/nodejs/node/pull/16669


Reviewed-By: default avatarAnatoli Papirovski <apapirovski@mac.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 5d0436fb
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