Allow detaching buffers from Sender::Builders to send later
This can be helpful, because unlike the Builder itself a detached buffer
is moveable.
Change-Id: I246750fcd7622c2eed0a72172f90fe02fcc9be07
diff --git a/aos/events/channel_preallocated_allocator.h b/aos/events/channel_preallocated_allocator.h
index 8a5d68f..5ca370b 100644
--- a/aos/events/channel_preallocated_allocator.h
+++ b/aos/events/channel_preallocated_allocator.h
@@ -16,7 +16,7 @@
ChannelPreallocatedAllocator(const ChannelPreallocatedAllocator &) = delete;
ChannelPreallocatedAllocator(ChannelPreallocatedAllocator &&other)
: data_(other.data_), size_(other.size_), channel_(other.channel_) {
- CHECK(!is_allocated());
+ CHECK(!is_allocated()) << ": May not overwrite in-use allocator";
CHECK(!other.is_allocated());
}
@@ -24,7 +24,7 @@
const ChannelPreallocatedAllocator &) = delete;
ChannelPreallocatedAllocator &operator=(
ChannelPreallocatedAllocator &&other) {
- CHECK(!is_allocated());
+ CHECK(!is_allocated()) << ": May not overwrite in-use allocator";
CHECK(!other.is_allocated());
data_ = other.data_;
size_ = other.size_;