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

src: add AliasedStruct utility



For http2 (and eventually QUIC) we have a struct that is backed
by a v8::BackingStore and exposed to the JavaScript side as an
ArrayBuffer and TypedArray. This is similar to AliasedBuffer
except that it is fronted by a struct on the C++ side.

```c++
struct foo {
  uint32_t ex1;
  uint32_t ex2;
};

AliasedStruct<foo> foo_;

foo_->ex1 = 1;
foo_->ex2 = 2;

foo_.GetArrayBuffer();
```

Signed-off-by: default avatarJames M Snell <jasnell@gmail.com>

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


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarGerhard Stöbich <deb2001-github@yahoo.de>
parent 81c03bce
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