Make raw senders able to send flatbuffers
The senders were placing in the front of the memory region, and the
readers were reading from the end of the memory region. Align the
raw senders with how flatbuffers use the memory.
This was found by trying to implement message_gateway.
Change-Id: I2d8fd5b6faafbbaf268ee036c851417cf5a02c74
diff --git a/aos/ipc_lib/queue_racer.cc b/aos/ipc_lib/queue_racer.cc
index bb754d8..f3b9d5c 100644
--- a/aos/ipc_lib/queue_racer.cc
+++ b/aos/ipc_lib/queue_racer.cc
@@ -278,7 +278,8 @@
ThreadPlusCount tpc;
ASSERT_EQ(length, sizeof(ThreadPlusCount));
- memcpy(&tpc, read_data, sizeof(ThreadPlusCount));
+ memcpy(&tpc, read_data + queue.message_data_size() - length,
+ sizeof(ThreadPlusCount));
if (will_wrap) {
// The queue won't chang out from under us, so we should get some amount