AnsweredAssumed Answered

Current heap pointer monitoring on MCUXpresso

Question asked by Stefano Di Maio on Jan 30, 2018
Latest reply on Feb 9, 2018 by LPCX support

Dear Sirs,

                I've a problem concerning the heap pointer monitoring.

CONFIGURATION :

 

1. MCUXpresso

2. MCU NXP 4078

3. C++ 11.0 and STL

 

Declaring variables in this way :

 

register void * stack_ptr asm ("sp");
extern char _pvHeapLimit __attribute__((weak));
extern char _pvHeapStart __attribute__((weak));

 

I can read the heap Limit and Start  but I cannot monitor the current heap pointer position.

 

I've read about the function unsigned __check_heap_overflow (void * new_end_of_heap) in the file

_cr_check_heap.c but is not what I'm looking for because it's a "manual" check.

 

Is it possible to verify the current heap pointer value by reading some variable like _pvHeapLimit ?

What's the right procedure to monitor the heap while allocating C++ STL object memory ( not by using "C" malloc )?

 

Best regards

Outcomes