#include "aos/ipc_lib/memory_estimation.h" | |
#include "aos/ipc_lib/memory_mapped_queue.h" | |
namespace aos::ipc_lib { | |
size_t TotalSharedMemoryUsage(const aos::Configuration *config, | |
const aos::Node *node) { | |
size_t total_size = 0; | |
for (const aos::Channel *channel : *CHECK_NOTNULL(config->channels())) { | |
if (aos::configuration::ChannelIsReadableOnNode(channel, node)) { | |
total_size += | |
LocklessQueueMemorySize(MakeQueueConfiguration(config, channel)); | |
} | |
} | |
return total_size; | |
} | |
} // namespace aos::ipc_lib |