4.8.3. Dynamic Memory Allocation¶
Connext DDS Micro allocates heap memory to create internal data-structures. It is important to know that Connext DDS Micro manages memory allocated from the system heap using its own internal memory management, and only returns memory allocated from the system back to the system when something is deleted. That is, if an application never deletes anything, no memory is returned to the system.
As a rule of thumb, in Connext DDS Micro the only APIs that allocate heap memory are:
Those that contain the word “new”, i.e. DDS_WaitSet_new().
Those that contain the word “create”, i.e. DDS_DomainParticipantFactory_create_participant().
And the only APIs that free memory are:
Those that contain the word “delete”, i.e. OSAPI_Waitset_delete().
Those that contain the word “free”, i.e. DDS_String_free().
Connext DDS Micro does not support dynamically allocating resources beyond the initial configuration. That is, all resource limits must be finite. This restriction may be removed in a future version.