Do I have to expect that the VST breaks as I add array elements, because at some point the array gets moved to a larger memory block, invalidating all the stored pointers?
I guess this may happen. I do not know how VST operates, but
VST.AddChild(parentnode, pointer); seems to allocate memory block (using
GetMem (resultnode, recordsize)) if pointer is not defined, but if pointer is defined then it just stores the address internally.
In this kind of structure, the default is that you do not keep the record data yourself (
ArrPayLoad in your case). You find a node in someway, and just retrieve the data in it. But sometimes it is necessary to maintain the data outside VST.
So I recommend you to keep array of pointers to record, not record data themselves, as I have shown in another thread. In this way, even though the physical address of ArrPPayLoad (which is
array of PPayLoad) is changed, the address of records stored in the ArrPPayLoad and VST themselves are not changed.
Hope my comment is not offensive to you... I'm answering based on assumptions and more than you asked.