Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordotnet-bot <dotnet-bot@microsoft.com>2017-07-07 02:30:39 +0300
committerdotnet-bot <dotnet-bot@microsoft.com>2017-07-07 02:30:39 +0300
commit55abc5bf1d75837efa8b8b678825399f29b140e1 (patch)
treead044ebb877b4240502fe080f364376b3a8be120 /src/Native/Runtime/GCHelpers.cpp
parent89b5c5033c17909c4bc9882d99746e4c8d4597ac (diff)
Implement GC.GetAllocatedBytesForCurrentThread for CoreRT.
[tfs-changeset: 1664883]
Diffstat (limited to 'src/Native/Runtime/GCHelpers.cpp')
-rw-r--r--src/Native/Runtime/GCHelpers.cpp8
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;
+}