(TMS570LC4, nested interrupt, C++, FreeRTOS V9.0.0rc2, compiler TI v5.2.7, rtos running ok).
Using heap_1, I want to know if I can also use new() and standard malloc at other places in my application ? Is there a conflict to do this ?
My problem is that when I use standard C++ librairy, like map stuff
mapTaskId.insert( std::make_pair( ptr->getId(), task ) ); ... pos = mapTaskId.find( taskId ); ...
after a couple of insert, these thing do not work anymore, it seems there is a problem.
On something related, I’ve tried to manage memory using FreeRtos pvPortMalloc() instead of pure new() using this code:
////Use RTOS's allocation strategy instead of new. ptr = pvPortMalloc( ..., sizeof( ThreadMsg) ); ////A trick to call the constructor without creating the object. new(ptr) ThreadMsg( (TaskFunction_t)TaskBased::OSCallBack, task->stackSize, task->priority, sizeof(TaskBased::Message), task->mbNbElement ); //instead ofcreating the object with new like this: //ptr = new ThreadMsg( (TaskFunction_t)TaskBased::OSCallBack, task->stackSize, //task->priority, sizeof(TaskBased::Message), task->mbNbElement );
Do I really have to use that trick ? Or I can use new with no problem ?