Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/FChange
Description
Gets the approximate number of bytes this change takes up in memory.
Used to
- determine the size of transactions based on a custom change, e.g. when trimming the oldest transactions when the undo stack size is exceeded.
- displaying the stack size, e.g. in the Undo Panel.
A typical implementation returns the size of any dynamically allocated memory, such GetAllocatedSize called on its containers (TArray, TSet, TMap). You should consider adding sizeof(FMyChange), if it's not insignificant. Remember: it's enough to return the approx. allocation size; it's unreasonable to expect every FChange implementation to return the exact amount, which also is not needed for the purpose of this function. Keep in mind, that for nested containers you need to call GetAllocatedSize recursively, e.g. for a "TArray
This function is introduced in 5.7: too many FChange implementations exist so this function will need to be implemented gradually.
| Name | GetSize |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/Change.h |
| Include Path | #include "Misc/Change.h" |
virtual SIZE_T GetSize() const
The approximate number of bytes this change takes up in memory.