Hi Ralph,

A capnp::word is just an aligned 8-byte value. ArrayPtr<word> is a pointer
to a raw data buffer. The reason we use ArrayPtr<word> instead of
ArrayPtr<byte> is to show that the buffer is aligned on an 8-byte boundary
and its size is a multiple of 8 bytes.

You can do `array.asBytes()` to convert any ArrayPtr<T> to ArrayPtr<byte>.
Use `array.begin()` to get a pointer to the beginning of the buffer and
`array.size()` to get the number of elements in the array.

-Kenton

On Wed, Nov 28, 2018 at 12:34 PM <[email protected]> wrote:

> Hi,
>
> Since the level 4 thing takes a few thoughts, first I want to simulate
> such an object cloud using redis.
> Means I want to, if I understood correctly write a messagebuilder backing
> the segments using redis strings of a certain key. I'd prefer a write
> through mechanism.
>
> I see the MessageBuilder allocates segments of some memory referenced by
> the type ArrayPtr<word> where word "represents" a byte in some yet unknown
> way.
> This part I don't get yet. What is behind kj::ArrayPtr and how could I
> utilize that to at least sync the memory with redis, better directly write
> and read through without allocating local memory at all.
>
> BR
> Ralph
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at https://groups.google.com/group/capnproto.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to