summaryrefslogtreecommitdiff
path: root/src/gc/gcimpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gc/gcimpl.h')
-rw-r--r--src/gc/gcimpl.h54
1 files changed, 30 insertions, 24 deletions
diff --git a/src/gc/gcimpl.h b/src/gc/gcimpl.h
index cb91c4dc3e..2a51d477b0 100644
--- a/src/gc/gcimpl.h
+++ b/src/gc/gcimpl.h
@@ -39,6 +39,11 @@ void GCProfileWalkHeap();
class gc_heap;
class CFinalize;
+extern bool g_fFinalizerRunOnShutDown;
+extern bool g_built_with_svr_gc;
+extern uint8_t g_build_variant;
+extern VOLATILE(int32_t) g_no_gc_lock;
+
class GCHeap : public IGCHeapInternal
{
protected:
@@ -80,19 +85,19 @@ public:
void DiagTraceGCSegments ();
void PublishObject(uint8_t* obj);
- BOOL IsGCInProgressHelper (BOOL bConsiderGCStart = FALSE);
+ bool IsGCInProgressHelper (bool bConsiderGCStart = false);
+
+ uint32_t WaitUntilGCComplete (bool bConsiderGCStart = false);
- uint32_t WaitUntilGCComplete (BOOL bConsiderGCStart = FALSE);
+ void SetGCInProgress(bool fInProgress);
- void SetGCInProgress(BOOL fInProgress);
+ bool RuntimeStructuresValid();
CLREvent * GetWaitForGCEvent();
HRESULT Initialize ();
//flags can be GC_ALLOC_CONTAINS_REF GC_ALLOC_FINALIZE
- Object* Alloc (size_t size, uint32_t flags);
- Object* AllocAlign8 (size_t size, uint32_t flags);
Object* AllocAlign8 (gc_alloc_context* acontext, size_t size, uint32_t flags);
private:
Object* AllocAlign8Common (void* hp, alloc_context* acontext, size_t size, uint32_t flags);
@@ -101,9 +106,9 @@ public:
Object* Alloc (gc_alloc_context* acontext, size_t size, uint32_t flags);
void FixAllocContext (gc_alloc_context* acontext,
- BOOL lockp, void* arg, void *heap);
+ bool lockp, void* arg, void *heap);
- Object* GetContainingObject(void *pInteriorPtr);
+ Object* GetContainingObject(void *pInteriorPtr, bool fCollectedGenOnly);
#ifdef MULTIPLE_HEAPS
static void AssignHeap (alloc_context* acontext);
@@ -116,15 +121,15 @@ public:
void HideAllocContext(alloc_context*);
void RevealAllocContext(alloc_context*);
- BOOL IsObjectInFixedHeap(Object *pObj);
+ bool IsObjectInFixedHeap(Object *pObj);
- HRESULT GarbageCollect (int generation = -1, BOOL low_memory_p=FALSE, int mode=collection_blocking);
+ HRESULT GarbageCollect (int generation = -1, bool low_memory_p=false, int mode=collection_blocking);
////
// GC callback functions
// Check if an argument is promoted (ONLY CALL DURING
// THE PROMOTIONSGRANTED CALLBACK.)
- BOOL IsPromoted (Object *object);
+ bool IsPromoted (Object *object);
size_t GetPromotedBytes (int heap_index);
@@ -152,8 +157,8 @@ public:
//returns the generation number of an object (not valid during relocation)
unsigned WhichGeneration (Object* object);
// returns TRUE is the object is ephemeral
- BOOL IsEphemeral (Object* object);
- BOOL IsHeapPointer (void* object, BOOL small_heap_only = FALSE);
+ bool IsEphemeral (Object* object);
+ bool IsHeapPointer (void* object, bool small_heap_only = false);
void ValidateObjectMember (Object *obj);
@@ -168,13 +173,13 @@ public:
int GetLOHCompactionMode();
void SetLOHCompactionMode(int newLOHCompactionyMode);
- BOOL RegisterForFullGCNotification(uint32_t gen2Percentage,
+ bool RegisterForFullGCNotification(uint32_t gen2Percentage,
uint32_t lohPercentage);
- BOOL CancelFullGCNotification();
+ bool CancelFullGCNotification();
int WaitForFullGCApproach(int millisecondsTimeout);
int WaitForFullGCComplete(int millisecondsTimeout);
- int StartNoGCRegion(uint64_t totalSize, BOOL lohSizeKnown, uint64_t lohSize, BOOL disallowFullBlockingGC);
+ int StartNoGCRegion(uint64_t totalSize, bool lohSizeKnown, uint64_t lohSize, bool disallowFullBlockingGC);
int EndNoGCRegion();
unsigned GetGcCount();
@@ -184,7 +189,7 @@ public:
PER_HEAP_ISOLATED HRESULT GetGcCounters(int gen, gc_counters* counters);
- size_t GetValidSegmentSize(BOOL large_seg = FALSE);
+ size_t GetValidSegmentSize(bool large_seg = false);
static size_t GetValidGen0MaxSize(size_t seg_size);
@@ -194,11 +199,12 @@ public:
PER_HEAP_ISOLATED size_t GetNumberFinalizableObjects();
PER_HEAP_ISOLATED size_t GetFinalizablePromotedCount();
- void SetFinalizeQueueForShutdown(BOOL fHasLock);
- BOOL FinalizeAppDomain(AppDomain *pDomain, BOOL fRunFinalizers);
- BOOL ShouldRestartFinalizerWatchDog();
+ void SetFinalizeQueueForShutdown(bool fHasLock);
+ bool FinalizeAppDomain(AppDomain *pDomain, bool fRunFinalizers);
+ bool ShouldRestartFinalizerWatchDog();
void DiagWalkObject (Object* obj, walk_fn fn, void* context);
+ void SetFinalizeRunOnShutdown(bool value);
public: // FIX
@@ -229,12 +235,12 @@ public: // FIX
#ifndef DACCESS_COMPILE
HRESULT WaitUntilConcurrentGCCompleteAsync(int millisecondsTimeout); // Use in native threads. TRUE if succeed. FALSE if failed or timeout
#endif
- BOOL IsConcurrentGCInProgress();
+ bool IsConcurrentGCInProgress();
// Enable/disable concurrent GC
void TemporaryEnableConcurrentGC();
void TemporaryDisableConcurrentGC();
- BOOL IsConcurrentGCEnabled();
+ bool IsConcurrentGCEnabled();
PER_HEAP_ISOLATED CLREvent *WaitForGCEvent; // used for syncing w/GC
@@ -253,7 +259,7 @@ private:
}
public:
//return TRUE if GC actually happens, otherwise FALSE
- BOOL StressHeap(gc_alloc_context * acontext = 0);
+ bool StressHeap(gc_alloc_context * acontext);
#ifndef FEATURE_REDHAWK // Redhawk forces relocation a different way
#ifdef STRESS_HEAP
@@ -273,7 +279,7 @@ protected:
virtual void DiagDescrGenerations (gen_walk_fn fn, void *context);
- virtual void DiagWalkSurvivorsWithType (void* gc_context, record_surv_fn fn, size_t diag_context, walk_surv_type type);
+ virtual void DiagWalkSurvivorsWithType (void* gc_context, record_surv_fn fn, void* diag_context, walk_surv_type type);
virtual void DiagWalkFinalizeQueue (void* gc_context, fq_walk_fn fn);
@@ -283,7 +289,7 @@ protected:
virtual void DiagScanDependentHandles (handle_scan_fn fn, int gen_number, ScanContext* context);
- virtual void DiagWalkHeap(walk_fn fn, void* context, int gen_number, BOOL walk_large_object_heap_p);
+ virtual void DiagWalkHeap(walk_fn fn, void* context, int gen_number, bool walk_large_object_heap_p);
public:
Object * NextObj (Object * object);