void () { PointerReference[] newReferences = new PointerReference[size * 3 / 2 + 1]; int index = 0; // don't use processAlivePointers/removeReference since it can unregister the whole pointer list, and we're not prepared to that for (PointerReference ref : references) { if (ref != null) { storePointerReference(newReferences, index++, ref); } } assert index == size : index + " != " + size; references = newReferences; nextAvailableIndex = index; }