SaDynDataMove copies data from the parameter named “data” to a dynamic data object (named dd). This function overwrites possible existing data.
The parameter dd must point to a Dynamic Data Object previously created with the SaDynDataCreate function.
Note SaDynDataMove copies the data. To copy just the reference rather than the data, see SaDynDataMoveRef.
Typically, the functions SaDynDataMove and SaDynDataAppend are used to set and modify the data value inside the dynamic data object. More memory will be automatically allocated when necessary and all the associated memory will be automatically deallocated when the dynamic data object is disposed of using SaDynDataFree. The user can access the data or the length using the respective functions SaDynDataGetData and SaDynDataGetLen.
The use of SaDynDataMove and SaDynDataAppend may not be feasible when the data already exists completely in a memory buffer. In addition to increasing the memory usage by keeping two copies of the same data, the overhead of thememory copy may be significant if the buffers are large. Therefore, it may be wise to directly assign the data pointer by using SaDynDataMoveRef (rather than copying by using SaDynDataMove). In this case, the user may modify or deallocate the memory buffer only after the dynamic data object itself has been freed.