diff options
author | Jan Kotas <jkotas@microsoft.com> | 2015-02-25 16:07:43 -0800 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2015-02-25 16:07:43 -0800 |
commit | 4f74a99e296d929945413c5a65d0c61bb7f2c32a (patch) | |
tree | 4e27f3bc131b203627511457c2f86f6e5a67788a /src/vm/comutilnative.cpp | |
parent | d1a4418c1284ee770e1cff99fe7396d6111dc488 (diff) | |
download | coreclr-4f74a99e296d929945413c5a65d0c61bb7f2c32a.tar.gz coreclr-4f74a99e296d929945413c5a65d0c61bb7f2c32a.tar.bz2 coreclr-4f74a99e296d929945413c5a65d0c61bb7f2c32a.zip |
Allow users to specify a no GC region (on behalf of maonis)
This mode lets users to specify an allocation amount for which no GCs would happen. Sometimes during the absolutely performance critical paths users have the desire to allocate without interference from the GC. If there is enough memory, GC will not kick in while this mode is set.
[tfs-changeset: 1421386]
Diffstat (limited to 'src/vm/comutilnative.cpp')
-rw-r--r-- | src/vm/comutilnative.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/vm/comutilnative.cpp b/src/vm/comutilnative.cpp index ae9a9c18ed..6d1824ee38 100644 --- a/src/vm/comutilnative.cpp +++ b/src/vm/comutilnative.cpp @@ -1753,6 +1753,41 @@ FCIMPL2(int, GCInterface::CollectionCount, INT32 generation, INT32 getSpecialGCC } FCIMPLEND +int QCALLTYPE GCInterface::StartNoGCRegion(INT64 totalSize, BOOL lohSizeKnown, INT64 lohSize, BOOL disallowFullBlockingGC) +{ + QCALL_CONTRACT; + + int retVal = 0; + + BEGIN_QCALL; + + GCX_COOP(); + + retVal = GCHeap::GetGCHeap()->StartNoGCRegion((ULONGLONG)totalSize, + lohSizeKnown, + (ULONGLONG)lohSize, + disallowFullBlockingGC); + + END_QCALL; + + return retVal; +} + +int QCALLTYPE GCInterface::EndNoGCRegion() +{ + QCALL_CONTRACT; + + int retVal = FALSE; + + BEGIN_QCALL; + + retVal = GCHeap::GetGCHeap()->EndNoGCRegion(); + + END_QCALL; + + return retVal; +} + /*===============================GetGenerationWR================================ **Action: Returns the generation in which the object pointed to by a WeakReference is found. **Returns: |