A TwinCAT library for creating and manipulating dynamic collections of data in TwinCAT. It provides multiple data structures such as ArrayList (a dynamic array), List (a doubly linked list that is optimized for sequential access and mutation), Set, Map, Queue, Stack and more. Examples are in the project.
If the memory allocation failes, no error is thrown and bSuccess is set to TRUE. There is no feedback for the user that the object was not saved in the collection.
Hi @fisothemes
When removing an element from a FB_Tree_Map the map is balanced. I suspect the balancing here is not correct. Because the node is deleted first and then the balancing is done with this deleted node, which memory is not anymore in use.
As you can see in the printscreen, the memory area of the pTemp node which was removed before is now already in use again by other dynamic objects (in my program). This can lead to exceptions.
I'm not sure, but shouldn't balancing be done from the previsous node (pTemp^.pParent) in this case?
Which have to be saved before removing the pTemp.
e.g.
pPrevious := pTmp^.pParent;
THIS^.Remove_Node(pTmp);
THIS^.Balance(pPrevious);