Page 1 of 1

hooking core allocation failures

Posted: Wed Dec 13, 2017 6:44 pm
by jschall
Can a define be added for hooking core allocation failures?
e.g.:

Code: Select all

--- a/os/common/oslib/src/chmemcore.c
+++ b/os/common/oslib/src/chmemcore.c
@@ -123,6 +123,7 @@ void *chCoreAllocAlignedWithOffsetI(size_t size,
 
   /* Considering also the case where there is numeric overflow.*/
   if ((next > ch_memcore.endmem) || (next < ch_memcore.nextmem)) {
+    CH_CFG_CORE_ALLOCATOR_FAILURE_HOOK();
     return NULL;
   }

Re: hooking core allocation failures

Posted: Sun Jan 20, 2019 3:26 pm
by Giovanni
Hi,

Moving this topic in the "change request" forum.

It is possible but I cannot guarantee when, 18.1 is already being tested and would have to start over.

Giovanni