Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit fc5385e

Browse files
Move ResetOBJECTHANDLE and the associated holder to the VM side.
1 parent ae75f5d commit fc5385e

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/gc/objecthandle.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@ void GCHandleValidatePinnedObject(OBJECTREF obj);
8080

8181
int GetCurrentThreadHomeHeapNumber();
8282

83-
inline void ResetOBJECTHANDLE(OBJECTHANDLE handle)
84-
{
85-
WRAPPER_NO_CONTRACT;
86-
87-
HndAssignHandle(handle, NULL);
88-
}
89-
90-
#ifndef FEATURE_REDHAWK
91-
typedef Holder<OBJECTHANDLE,DoNothing<OBJECTHANDLE>,ResetOBJECTHANDLE> ObjectInHandleHolder;
92-
#endif
93-
9483
/*
9584
* Table maintenance routines
9685
*/

src/vm/gchandleutilities.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ inline void* InterlockedCompareExchangeObjectInHandle(OBJECTHANDLE handle, OBJEC
196196
return GCHandleUtilities::GetGCHandleManager()->CompareAndSwapObjectInHandle(handle, OBJECTREFToObject(object), OBJECTREFToObject(comparandObject));
197197
}
198198

199+
inline void ResetOBJECTHANDLE(OBJECTHANDLE handle)
200+
{
201+
GCHandleUtilities::GetGCHandleManager()->StoreObjectInHandle(handle, NULL);
202+
}
203+
199204
// Handle destruction convenience functions
200205

201206
inline void DestroyHandle(OBJECTHANDLE handle)
@@ -336,6 +341,7 @@ typedef Wrapper<OBJECTHANDLE, DoNothing<OBJECTHANDLE>, DestroyRefcountedHandle>
336341
typedef Holder<OBJECTHANDLE, DoNothing<OBJECTHANDLE>, DestroyLongWeakHandle> LongWeakHandleHolder;
337342
typedef Holder<OBJECTHANDLE, DoNothing<OBJECTHANDLE>, DestroyGlobalStrongHandle> GlobalStrongHandleHolder;
338343
typedef Holder<OBJECTHANDLE, DoNothing<OBJECTHANDLE>, DestroyGlobalShortWeakHandle> GlobalShortWeakHandleHolder;
344+
typedef Holder<OBJECTHANDLE, DoNothing<OBJECTHANDLE>, ResetOBJECTHANDLE> ObjectInHandleHolder;
339345

340346
class RCOBJECTHANDLEHolder : public RefCountedOHWrapper
341347
{

0 commit comments

Comments
 (0)