From 3a4b10421decd2229f439066e76a3b209470e2a2 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Fri, 21 Jun 2019 16:21:13 +0200 Subject: [PATCH] Don't retain all data in builtin-topics readers The built-in topics readers in the RMW node are currently not used for anything other than triggering the guard condition. All the query functions just get their own data set from Cyclone. Taking all samples instead of just the not-alive ones reduces memory usage. Signed-off-by: Erik Boasson --- rmw_cyclonedds_cpp/src/rmw_node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmw_cyclonedds_cpp/src/rmw_node.cpp b/rmw_cyclonedds_cpp/src/rmw_node.cpp index 91473c3..0276584 100644 --- a/rmw_cyclonedds_cpp/src/rmw_node.cpp +++ b/rmw_cyclonedds_cpp/src/rmw_node.cpp @@ -300,7 +300,7 @@ static void ggcallback (dds_entity_t rd, void *varg) auto node_impl = static_cast (varg); void *msg = 0; dds_sample_info_t info; - while (dds_take_mask (rd, &msg, &info, 1, 1, DDS_ANY_SAMPLE_STATE | DDS_ANY_VIEW_STATE | DDS_NOT_ALIVE_DISPOSED_INSTANCE_STATE | DDS_NOT_ALIVE_NO_WRITERS_INSTANCE_STATE) > 0) { + while (dds_take (rd, &msg, &info, 1, 1) > 0) { dds_return_loan (rd, &msg, 1); } if (rmw_trigger_guard_condition (node_impl->graph_guard_condition) != RMW_RET_OK) {