Implement no-arg watchers efficiently in ShmEventLoop
Change-Id: I0efd8d3a639a1c6bb959b2ec263ffe8a3a84917d
diff --git a/aos/ipc_lib/lockless_queue.cc b/aos/ipc_lib/lockless_queue.cc
index 7126ffd..f31d80d 100644
--- a/aos/ipc_lib/lockless_queue.cc
+++ b/aos/ipc_lib/lockless_queue.cc
@@ -792,7 +792,9 @@
}
*monotonic_remote_time = m->header.monotonic_remote_time;
*realtime_remote_time = m->header.realtime_remote_time;
- memcpy(data, m->data(memory_->message_data_size()), message_data_size());
+ if (data) {
+ memcpy(data, m->data(memory_->message_data_size()), message_data_size());
+ }
*length = m->header.length;
// And finally, confirm that the message *still* points to the queue index we