77 for (
int i = 0; i < weakRefs.Length; i++)
79 if (weakRefs[i].IsAllocated ==
false)
81 weakRefs[i] = GCHandle.Alloc(o, GCHandleType.WeakTrackResurrection);
82 return -(i | (1 << 30));
86 var len = weakRefs.Length;
87 var tmp =
new GCHandle[len * 2];
88 Array.Copy(weakRefs, 0, tmp, 0, len);
89 tmp[len] = GCHandle.Alloc(o, GCHandleType.WeakTrackResurrection);
91 return -(len | (1 << 30));