blob: d193c75e43891a4d64c0bda7cf5fe8c8365679c6 [file] [log] [blame]
James Kuszmaulb3fb78a2024-05-09 15:35:29 -07001#include "aos/ipc_lib/memory_estimation.h"
2
3#include "aos/ipc_lib/memory_mapped_queue.h"
4namespace aos::ipc_lib {
5size_t TotalSharedMemoryUsage(const aos::Configuration *config,
6 const aos::Node *node) {
7 size_t total_size = 0;
8 for (const aos::Channel *channel : *CHECK_NOTNULL(config->channels())) {
9 if (aos::configuration::ChannelIsReadableOnNode(channel, node)) {
10 total_size +=
11 LocklessQueueMemorySize(MakeQueueConfiguration(config, channel));
12 }
13 }
14 return total_size;
15}
16} // namespace aos::ipc_lib