summaryrefslogtreecommitdiff
path: root/src/gc
diff options
context:
space:
mode:
authorAditya Mandaleeka <adityam@microsoft.com>2017-03-31 17:09:46 -0700
committerAditya Mandaleeka <adityam@microsoft.com>2017-03-31 19:30:21 -0700
commitdab2f6b76a1ed088a871374189e2133db9c9accb (patch)
treea8ae398a2f78f8ff29a480d8f9e083ae60d73bd8 /src/gc
parent8d02c0786825a27d67fb2af150f751dbda360bef (diff)
downloadcoreclr-dab2f6b76a1ed088a871374189e2133db9c9accb.tar.gz
coreclr-dab2f6b76a1ed088a871374189e2133db9c9accb.tar.bz2
coreclr-dab2f6b76a1ed088a871374189e2133db9c9accb.zip
Add way to get table for handle and ADIndex for handletable.
Diffstat (limited to 'src/gc')
-rw-r--r--src/gc/gchandletable.cpp10
-rw-r--r--src/gc/gchandletableimpl.h4
-rw-r--r--src/gc/gcinterface.h14
3 files changed, 27 insertions, 1 deletions
diff --git a/src/gc/gchandletable.cpp b/src/gc/gchandletable.cpp
index a4c3352b86..c096d9fbd6 100644
--- a/src/gc/gchandletable.cpp
+++ b/src/gc/gchandletable.cpp
@@ -22,3 +22,13 @@ void GCHandleTable::Shutdown()
{
Ref_Shutdown();
}
+
+void* GCHandleTable::GetHandleTableContext(HHANDLETABLE hTable)
+{
+ return (void*)((uintptr_t)::HndGetHandleTableADIndex(hTable).m_dwIndex);
+}
+
+HHANDLETABLE GCHandleTable::GetHandleTableForHandle(OBJECTHANDLE handle)
+{
+ return ::HndGetHandleTable(handle);
+}
diff --git a/src/gc/gchandletableimpl.h b/src/gc/gchandletableimpl.h
index 233e326a64..eafb0a0398 100644
--- a/src/gc/gchandletableimpl.h
+++ b/src/gc/gchandletableimpl.h
@@ -13,6 +13,10 @@ public:
virtual bool Initialize();
virtual void Shutdown();
+
+ virtual void* GetHandleTableContext(HHANDLETABLE hTable);
+
+ virtual HHANDLETABLE GetHandleTableForHandle(OBJECTHANDLE handle);
};
#endif // GCHANDLETABLE_H_
diff --git a/src/gc/gcinterface.h b/src/gc/gcinterface.h
index 77425b1cc3..e1e7301247 100644
--- a/src/gc/gcinterface.h
+++ b/src/gc/gcinterface.h
@@ -149,10 +149,18 @@ struct segment_info
void * pvMem; // base of the allocation, not the first object (must add ibFirstObject)
size_t ibFirstObject; // offset to the base of the first object in the segment
size_t ibAllocated; // limit of allocated memory in the segment (>= firstobject)
- size_t ibCommit; // limit of committed memory in the segment (>= alllocated)
+ size_t ibCommit; // limit of committed memory in the segment (>= allocated)
size_t ibReserved; // limit of reserved memory in the segment (>= commit)
};
+
+/*
+ * handle to handle table
+ */
+typedef DPTR(struct HandleTable) PTR_HandleTable;
+typedef DPTR(PTR_HandleTable) PTR_PTR_HandleTable;
+typedef PTR_HandleTable HHANDLETABLE;
+typedef PTR_PTR_HandleTable PTR_HHANDLETABLE;
#ifdef PROFILING_SUPPORTED
#define GC_PROFILING //Turn on profiling
#endif // PROFILING_SUPPORTED
@@ -391,6 +399,10 @@ public:
virtual bool Initialize() = 0;
virtual void Shutdown() = 0;
+
+ virtual void* GetHandleTableContext(HHANDLETABLE hTable) = 0;
+
+ virtual HHANDLETABLE GetHandleTableForHandle(OBJECTHANDLE handle) = 0;
};
// IGCHeap is the interface that the VM will use when interacting with the GC.