1. 25 Apr, 2017 2 commits
    • Kenton Varda's avatar
      Work around Clang and GCC disagreeing on name mangling. · bcd9e553
      Kenton Varda authored
      Specifically, consider:
      
          capnp::BuilderFor<capnp::DynamicStruct> capnp::Orphan<capnp::AnyPointer>::getAs<capnp::DynamicStruct>(capnp::StructSchema)
      
      Note that `BuilderFor` is a "template using" directive which expands into something more complicated.
      
      GCC mangles the symbol as:
      
          _ZN5capnp6OrphanINS_10AnyPointerEE5getAsINS_13DynamicStructEEENS_11BuilderFor_IT_Xcl4kindIS6_EEEE4TypeENS_12StructSchemaE
      
      Which `c++filt` decodes as:
      
          capnp::BuilderFor_<capnp::DynamicStruct, (kind<capnp::DynamicStruct>)()>::Type capnp::Orphan<capnp::AnyPointer>::getAs<capnp::DynamicStruct>(capnp::StructSchema)
      
      Note that `BuilderFor_<...>::Type` here ends up being a typedef for `DynamicStruct::Builder`. It seems weird to me that the symbol name would not substitute this typedef.
      
      Clang, meanwhile, mangles the symbol as:
      
          _ZN5capnp6OrphanINS_10AnyPointerEE5getAsINS_13DynamicStructEEENS_11BuilderFor_IT_Xclgssr5capnpE4kindIS6_EEEE4TypeENS_12StructSchemaE
      
      Which `c++filt` does not seem to be able to demangle at all. But, it looks like `capnp::kind` is in there, suggesting that, again, the typedef wasn't substituted.
      
      I don't know who is right, but if we inline the whole thing, the problem goes away.
      bcd9e553
    • Kenton Varda's avatar
      Fix dynamic pipelining on 'Capability' type. · 559a592b
      Kenton Varda authored
      Fixes #336
      559a592b
  2. 11 Apr, 2017 1 commit
  3. 30 Mar, 2017 2 commits
    • Kenton Varda's avatar
      Remame Guarded -> Bounded. · 168cb630
      Kenton Varda authored
      168cb630
    • Kenton Varda's avatar
      WIP use bounded types -- all tests passing. · 093fac4a
      Kenton Varda authored
      TODO:
      - Rename Guarded to Bounded?
      - Consider bounded array (where size and indexes are bounded quantities).
      - Implement non-CAPNP_DEBUG_TYPES fallback.
        - Don't allow casting kj::maxValue to bounded type, this won't work right when not using debug types!
      - Verify that this change doesn't hurt performance.
      093fac4a
  4. 24 Jul, 2016 1 commit
  5. 19 May, 2016 1 commit
  6. 01 May, 2016 1 commit
  7. 03 Jul, 2015 1 commit
    • Kenton Varda's avatar
      Refactor how messages are imbued with a capability table. · 5413038b
      Kenton Varda authored
      **The problem**
      
      The methods MessageReader::initCapTable() and MessageBuilder::getCapTable() always felt rather hacky. initCapTable() in particular feels like something that should be handled by the constructor. However, in practice, the cap table is often initialized based on a table encoded within the message itself. That is, an RPC message contains a "payload" which includes both the application-level message structure and a table of capabilities. The cap table has to be processed first, then initCapTable() is called on the overall message, before the application structure can safely be read.
      
      The really weird part about this is that even though the cap table only applies to one branch of the message (the payload), it is set on the *whole* MessageReader. This implies, for example, that it would be impossible to have a message that contains multiple payloads. We haven't had any need for such a thing, but an implemnetation that has such artificial limitations feels very wrong.
      
      MessageBuilder has similar issues going in the opposite direction.
      
      All of this ugliness potentially gets worse when we introduce "membranes". We want a way to intercept capabilities as they are being read from or written to an RPC payload. Currently, the only plausible way to do that is, again, to apply a transformation to all capabilities in the message. In practice it seems like this would work out OK, but it again feels wrong -- we really want to take a single Reader or Builder and "wrap" it so that transformations are applied on capabilities read/written through it.
      
      **The solution**
      
      This change fixes the problem by adding a new pointer to each struct/list Reader/Builder that tracks the current cap table. So, now a Reader or Builder for a particular sub-object can be "imbued" with a cap table without affecting any other existing Readers/Builders pointing into the same message. The cap table is inherited by child Readers/Builders obtained through the original one.
      
      This approach matches up nicely with membranes, which should make their implementation nice and clean.
      
      This change unfortunately means that Readers and Builders are now bigger, possibly with some performance impact.
      5413038b
  8. 10 Jun, 2015 1 commit
  9. 29 Nov, 2014 1 commit
  10. 09 Nov, 2014 1 commit
  11. 26 Oct, 2014 1 commit
  12. 20 Oct, 2014 1 commit
    • Kenton Varda's avatar
      Generics: Tag generated types using members rather than template specialization. · 490acec8
      Kenton Varda authored
      That is to say, whereas previously we would extend capnp::typeId<T>() to a new type by declaring a specialization of it for that type, now we instead have the type contain a nested class called _capnpPrivate which contains a `typeId` constant.
      
      This is necessary because it is impossible to specialize a template for a type which is itself nested inside a template type. E.g. it's impossible to write a specialization `template <typename T> typeId<Foo<T>::Bar>()`; C++ simply doesn't support this. But with generics, Cap'n Proto will allow types to be nested inside templates, so we need this to work.
      490acec8
  13. 17 Oct, 2014 1 commit
  14. 20 Jun, 2014 1 commit
    • Kenton Varda's avatar
      Change license to MIT. · 889204fe
      Kenton Varda authored
      For portions currently copyright by Kenton (most of it), transfer copyright to Sandstorm Development Group, Inc. (Kenton's company).
      
      The license change is practically meaningless, as MIT and BSD 2-clause are legally equivalent. However, the BSD 2-clause license is sometimes confused for its ugly siblings, BSD 3-clause and BSD 4-clause. The MIT license is more immediately recognizeable for what it is.
      
      Rémy Blank and Jason Choy (the two non-trivial contributors) are on record as approving this change:
      
      https://groups.google.com/d/msg/capnproto/xXDd2HUOCcc/gbe_COIuXKYJ
      889204fe
  15. 05 Feb, 2014 1 commit
  16. 04 Feb, 2014 1 commit
  17. 10 Dec, 2013 1 commit
  18. 05 Dec, 2013 1 commit
  19. 04 Dec, 2013 1 commit
  20. 28 Nov, 2013 1 commit
    • Kenton Varda's avatar
      Revamp concurrency model, part 1: EventLoop no longer allows cross-thread event… · 7921c854
      Kenton Varda authored
      Revamp concurrency model, part 1:  EventLoop no longer allows cross-thread event queuing, simplifying many things.  Capability clients are no longer thread-safe, so they don't have to be so const.  In the future, explicit ways to communicate between threads will be re-added, but threads will be treated more like separate vats that just happen to have a particularly fat pipe.  Upcoming:  Remove mutexes.
      7921c854
  21. 14 Nov, 2013 2 commits
  22. 12 Nov, 2013 1 commit
  23. 15 Oct, 2013 2 commits
  24. 04 Oct, 2013 1 commit
  25. 24 Sep, 2013 4 commits
  26. 23 Sep, 2013 1 commit
  27. 29 Aug, 2013 1 commit
  28. 28 Aug, 2013 3 commits
  29. 26 Aug, 2013 3 commits