Hi, A double-far pointer is only needed when there is no space in the target object's segment to add a single-pointer landing pad. In this case, the landing pad itself must be allocated in a different segment and must be a double-far.
In the C++ implementation, this comes up when using orphans: it's possible to allocate an object without knowing yet where it will be linked into the object tree, and by the time it is later linked in, it may turn out that a double-far is the only way to do it. -Kenton On Sat, Mar 9, 2019, 8:12 PM <[email protected]> wrote: > > https://github.com/capnproto/capnproto/blob/master/c++/src/capnp/layout.c++#L1059 > > Can you please explain the rationale behind double far pointers and > exactly the scenario(s) that cause them to appear? I can't forcefully > create a scenario that requires them manually in code. > > To be specific: even after reading the encoding page, I'm not sure I > understand why a far pointer can't always point directly to the correct > segment and data as they only ever require a single word of memory. > > Thanks > > -- > 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.
