I know that trivially copied objects can be safely copied mine mallocto the appropriate storage location 1 and that the destination will have the same value as the source.
Is this also possible with realloc? That is, if reallocsome kind of repository that contains some objects of type T, and reallocdecides to move and copy the block, whether the objects in the new distributed repository intact and they started their life, and the lifetime of the objects in the old storage must be completed safely?
1 When I asked this question, I suggested that the “appropriate storage location” includes an uninitialized storage of suitable alignment and size, but as the MM answer below states that this standard is not actually supported by the standard. This would make it reallocdoubtful, since it is always copied to uninitialized storage.
source
share