C: fix support of weak references in GC

This commit is contained in:
Alexey Andreev 2019-08-26 19:50:10 +03:00
parent f028f8db37
commit 5a8284222a

View File

@ -219,7 +219,7 @@ public final class GC {
if (object.queue != null) { if (object.queue != null) {
enqueueMark(object.queue); enqueueMark(object.queue);
if (object.next != null && object.object != null) { if (object.next != null && object.object != null) {
enqueueMark(object); enqueueMark(object.object);
} }
} }
if (object.next == null && object.object != null) { if (object.next == null && object.object != null) {
@ -231,7 +231,7 @@ public final class GC {
private static void markReferenceQueue(RuntimeReferenceQueue object) { private static void markReferenceQueue(RuntimeReferenceQueue object) {
RuntimeReference reference = object.first; RuntimeReference reference = object.first;
while (reference != null) { while (reference != null) {
enqueueMark(object); enqueueMark(reference);
reference = reference.next; reference = reference.next;
} }
} }