[Concept,01/33] malloc: Double the allocation registry size

Message ID 20260416023021.626949-2-sjg@u-boot.org
State New
Headers
Series Fix memory leaks and test pollution in sandbox tests |

Commit Message

Simon Glass April 16, 2026, 2:29 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

When running the full test suite, the live allocation count can exceed
20000, overflowing the mcheck registry. Once that happens, further
allocations are still returned but their headers are not registered,
so leak reports cannot recover the caller string and simply show a
blank caller field. The failure is easy to miss because the
"registry overflow" message is printed only once and may be silenced
under the unit-test console.

Bump REGISTRY_SZ to 40000 so the whole suite fits. The array lives in
.data and only costs an extra 160KiB for sandbox builds, which is
acceptable for a debug-only feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/mcheck_core.inc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/common/mcheck_core.inc.h b/common/mcheck_core.inc.h
index 65f83836d61..968b058ba6d 100644
--- a/common/mcheck_core.inc.h
+++ b/common/mcheck_core.inc.h
@@ -71,7 +71,7 @@ 
 #define PADDINGFLOOD	((char)0x58)
 
 // Full test suite can exceed 10000 concurrent allocations
-#define REGISTRY_SZ	20000
+#define REGISTRY_SZ	40000
 #define CANARY_DEPTH	2
 
 // avoid problems with BSS at early stage: