MCPcopy Create free account
hub / github.com/Z3Prover/z3 / forceClear

Method forceClear

src/api/java/Z3ReferenceQueue.java:70–86  ·  view source on GitHub ↗

Clean all references stored in referenceList, regardless of whether they are in referenceQueue or not.

()

Source from the content-addressed store, hash-verified

68 * <b>regardless</b> of whether they are in {@code referenceQueue} or not.
69 */
70 @SuppressWarnings("StatementWithEmptyBody")
71 public void forceClear() {
72 // Decrement all reference counters
73 Reference<?> cur = referenceList.next;
74 while (cur.next != null) {
75 cur.decRef(ctx, cur.nativePtr);
76 cur = cur.next;
77 }
78
79 // Bulk-delete the reference list's entries
80 referenceList.next = cur;
81 cur.prev = referenceList;
82
83 // Empty the reference queue so that there are no living phantom references anymore.
84 // This makes sure that all stored phantom references can be GC'd now.
85 while (referenceQueue.poll() != null) {}
86 }
87
88 private static Reference<?> emptyList() {
89 Reference<?> head = new DummyReference();

Callers 1

closeMethod · 0.80

Calls 1

decRefMethod · 0.45

Tested by

no test coverage detected