summaryrefslogtreecommitdiff
path: root/common/mcheck_core.inc.h
diff options
context:
space:
mode:
authorEugene Uriev <eugeneuriev@gmail.com>2024-03-31 23:03:25 +0300
committerTom Rini <trini@konsulko.com>2024-04-12 16:23:06 -0600
commit7bceb16106e5db971e3b9c457d6274f7dbd76f7d (patch)
treeed7ac438d91b0649a7dae9671296ebfc11d3e520 /common/mcheck_core.inc.h
parent18c1bfafe0ccdd3229d91bbb07ed942e9f233f93 (diff)
mcheck: introduce mcheck_on_ramrelocation(.)
The using of pre-reloc/malloc_simple heap is too hard to follow after the relocation. So lets drop it from the pedantic registry and switch to dlmalloc, when moved. The offset is ignored, but kept in the API for the probable case, when that early heap is relocated too. Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
Diffstat (limited to 'common/mcheck_core.inc.h')
-rw-r--r--common/mcheck_core.inc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/mcheck_core.inc.h b/common/mcheck_core.inc.h
index 85a34de2958..bade03598fb 100644
--- a/common/mcheck_core.inc.h
+++ b/common/mcheck_core.inc.h
@@ -273,5 +273,16 @@ static void mcheck_initialize(mcheck_abortfunc_t new_func, char pedantic_flag)
mcheck_pedantic_flag = pedantic_flag;
}
+void mcheck_on_ramrelocation(size_t offset)
+{
+ char *p;
+ int i;
+ // Simple, but inaccurate strategy: drop the pre-reloc heap
+ 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;
+ }
+}
#endif
#endif