Allocates a weak pointer for an object, and then updates it when garbage collection occurs.
HObject** __cdecl GCGetPtr(HObject *phobj);
Returns an address to a pointer to a Java object handle.
*phobj | The address of a Java object. |
Given a pointer to an object, this function allocates and returns the address of that object pointer, and then updates the contained pointer when garbage collection occurs. Note that if the object gets freed during garbage collection, the value of the contained pointer will be NULL. A weak pointer is different from a strong pointer (as allocated by GCNewHandle). A weak pointer will not block garbage collection (removal) of the referenced object, but a strong pointer will. (Strong pointers are scanned like any other object during garbage collection; weak pointers are updated after the garbage collection has been completed.)