KJFPE wrote:
Hi
If you plase the following in your klinker file
define block HEAP with size = 0x2000, alignment = 8{ };
place in RAM_region {block HEAP};
it will work
it might work, but is it safe?
MQX does all its own memory management (I think).
Let's say we need to kill the C++thead due to an RTOS error. What happens to cout if it is on the heap? There is no explicit malloc. for cout...can cout be deleted? Looks like a recipe for a memory leak?
My belief is that a C++ thread should be able to be written that runs in MQX without having an externally defined heap. I know that this can be done because PEG+ is integrated with MQX and runs (we already discussed this). But PEG+ might not use stdio libraries so might avoid this issue by "accident"?
Since MQX insists on taking over the whole processor, startup code, IO pins, timers, device drivers etc. it would be kind of good to know the limitations of a mixed language environment.
In the more general case, I am simply looking for a way to configure either complier or linker or both which permits C++ application code to run on top of MQX as if MQX were a C++ RTL, but safely.
the fallback position is to abandon C++ altogether and try to write object oriented "C". ( (void *) pthis->do_stuff(void * paramset )
It works, but is it a good idea?
