From 850d21dcb9b7ab82016a464d6c05e5950da6fb9f Mon Sep 17 00:00:00 2001 From: "Jason B. Cox" Date: Sun, 30 Mar 2025 18:39:01 -0700 Subject: [PATCH] Add a static_assert to verify assumption about NodeInfoLite size (#6428) Co-authored-by: Ben Meadors --- src/mesh/mesh-pb-constants.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesh/mesh-pb-constants.h b/src/mesh/mesh-pb-constants.h index 1c86653dc..f748d295e 100644 --- a/src/mesh/mesh-pb-constants.h +++ b/src/mesh/mesh-pb-constants.h @@ -18,6 +18,10 @@ #define MAX_RX_TOPHONE 32 #endif +/// Verify baseline assumption of node size. If it increases, we need to reevaluate +/// the impact of its memory footprint, notably on MAX_NUM_NODES. +static_assert(sizeof(meshtastic_NodeInfoLite) <= 192, "NodeInfoLite size increased. Reconsider impact on MAX_NUM_NODES."); + /// max number of nodes allowed in the nodeDB #ifndef MAX_NUM_NODES #if defined(ARCH_STM32WL)