[Concept,26/35] malloc: Remove warning messages during relocation

Message ID 20251210000737.180797-27-sjg@u-boot.org
State New
Headers
Series malloc: Add heap debugging commands and mcheck caller tracking |

Commit Message

Simon Glass Dec. 10, 2025, 12:07 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Pre-relocation heap allocations are expected to be discarded during
relocation - this is normal behavior, not a warning condition.
Remove the verbose messages that were printed for each chunk.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 common/mcheck_core.inc.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Patch

diff --git a/common/mcheck_core.inc.h b/common/mcheck_core.inc.h
index 2839027564e..c2089add0d6 100644
--- a/common/mcheck_core.inc.h
+++ b/common/mcheck_core.inc.h
@@ -289,14 +289,14 @@  static void mcheck_initialize(mcheck_abortfunc_t new_func, char pedantic_flag)
 
 void mcheck_on_ramrelocation(size_t offset)
 {
-	char *p;
 	int i;
-	// Simple, but inaccurate strategy: drop the pre-reloc heap
+
+	/*
+	 * Pre-relocation heap allocations are no longer valid after
+	 * relocation. Clear the registry since we can't track them.
+	 */
 	for (i = 0; i < REGISTRY_SZ; ++i)
-		if ((p = mcheck_registry[i]) != NULL ) {
-			printf("mcheck, WRN: forgetting %p chunk\n", p);
-			mcheck_registry[i] = 0;
-		}
+		mcheck_registry[i] = 0;
 
 	mcheck_chunk_count = 0;
 }