diff options
author | dotnet-bot <dotnet-bot@microsoft.com> | 2017-07-07 02:30:39 +0300 |
---|---|---|
committer | dotnet-bot <dotnet-bot@microsoft.com> | 2017-07-07 02:30:39 +0300 |
commit | 55abc5bf1d75837efa8b8b678825399f29b140e1 (patch) | |
tree | ad044ebb877b4240502fe080f364376b3a8be120 /src/Native/Runtime/GCHelpers.cpp | |
parent | 89b5c5033c17909c4bc9882d99746e4c8d4597ac (diff) |
Implement GC.GetAllocatedBytesForCurrentThread for CoreRT.
[tfs-changeset: 1664883]
Diffstat (limited to 'src/Native/Runtime/GCHelpers.cpp')
-rw-r--r-- | src/Native/Runtime/GCHelpers.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Native/Runtime/GCHelpers.cpp b/src/Native/Runtime/GCHelpers.cpp index 405ff7c8b..4224db0ae 100644 --- a/src/Native/Runtime/GCHelpers.cpp +++ b/src/Native/Runtime/GCHelpers.cpp @@ -205,3 +205,11 @@ COOP_PINVOKE_HELPER(Int64, RhGetGCSegmentSize, ()) return (first > second) ? first : second; } + +COOP_PINVOKE_HELPER(Int64, RhGetAllocatedBytesForCurrentThread, ()) +{ + Thread *pThread = GetThread(); + gc_alloc_context *ac = pThread->GetAllocContext(); + Int64 currentAllocated = ac->alloc_bytes + ac->alloc_bytes_loh - (ac->alloc_limit - ac->alloc_ptr); + return currentAllocated; +} |