Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetAllocMemSize: Integer;
- {$IF CompilerVersion >= 18}
- var
- I: Integer;
- MemMgrState: TMemoryManagerState;
- {$IFEND}
- begin
- {$IF CompilerVersion < 18}
- Result := AllocMemSize;
- {$ELSE}
- GetMemoryManagerState(MemMgrState);
- Result := MemMgrState.TotalAllocatedMediumBlockSize +
- MemMgrState.TotalAllocatedLargeBlockSize;
- for I := 0 to High(MemMgrState.SmallBlockTypeStates) do
- Result := Result + MemMgrState.SmallBlockTypeStates[I].InternalBlockSize +
- MemMgrState.SmallBlockTypeStates[I].UseableBlockSize;
- {$IFEND}
- end;
Advertisement
Add Comment
Please, Sign In to add comment