Sets ownership for memory block.
A pointer to parent block.
A pointer to child block.
AName [in, optional]
A custom name for the AChildBlock block. Empty string (default) means "do not change name".
This function is a combination of MemLeaksSetParentBlock and MemLeaksName functions. MemLeaksOwn will name AChildBlock with AName (as MemLeaksName do) and sets AParentBlock as a parent to AChildBlock (as MemLeaksSetParentBlock do).
The difference is that MemLeaksOwn will not overwrite a parent link in AChildBlock if that link was already set. Whereas MemLeaksSetParentBlock will always set parent link. This difference allows you to use MemLeaksOwn to set ownership for reference-counted data types passed to you as arguments. For example, if string is passed to constructor of your object, and you save this string into field of your object - you may use MemLeaksOwnStr to claim ownership of this string.