Commit 773fffd6 authored by Kenton Varda's avatar Kenton Varda

Fixes #67. Also, prevent people from accidentally making MessageBuilder…

Fixes #67.  Also, prevent people from accidentally making MessageBuilder subclasses copyable/movable as brought up in issue #64.
parent 2602c0ec
...@@ -235,7 +235,6 @@ struct WirePointer { ...@@ -235,7 +235,6 @@ struct WirePointer {
uint32_t upper32Bits; uint32_t upper32Bits;
StructRef structRef; StructRef structRef;
// Also covers capabilities.
ListRef listRef; ListRef listRef;
......
...@@ -157,6 +157,7 @@ class MessageBuilder { ...@@ -157,6 +157,7 @@ class MessageBuilder {
public: public:
MessageBuilder(); MessageBuilder();
virtual ~MessageBuilder() noexcept(false); virtual ~MessageBuilder() noexcept(false);
KJ_DISALLOW_COPY(MessageBuilder);
virtual kj::ArrayPtr<word> allocateSegment(uint minimumSize) = 0; virtual kj::ArrayPtr<word> allocateSegment(uint minimumSize) = 0;
// Allocates an array of at least the given number of words, throwing an exception or crashing if // Allocates an array of at least the given number of words, throwing an exception or crashing if
......
...@@ -851,11 +851,11 @@ struct Payload { ...@@ -851,11 +851,11 @@ struct Payload {
struct CapDescriptor { struct CapDescriptor {
# **(level 1)** # **(level 1)**
# #
# When an application-defined type contains an interface pointer, that pointer's encoding is the # When an application-defined type contains an interface pointer, that pointer contains an index
# same as a struct pointer except that the bottom two bits are 1's instead of 0's. The pointer # into the message's capability table -- i.e. the `capTable` part of the `Payload`. Each
# actually points to an instance of `CapDescriptor`. The runtime API should not reveal the # capability in the table is represented as a `CapDescriptor`. The runtime API should not reveal
# CapDescriptor directly to the application, but should instead wrap it in some kind of callable # the CapDescriptor directly to the application, but should instead wrap it in some kind of
# object with methods corresponding to the interface that the capability implements. # callable object with methods corresponding to the interface that the capability implements.
# #
# Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the # Keep in mind that `ExportIds` in a `CapDescriptor` are subject to reference counting. See the
# description of `ExportId`. # description of `ExportId`.
......
Markdown is supported
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