Skip to content

Commit fa01c11

Browse files
committed
reorder fields in SwiftInstance, fields before methods
1 parent a0b8466 commit fa01c11

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

SwiftKitCore/src/main/java/org/swift/swiftkit/core/SwiftInstance.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,9 @@
1818

1919
public abstract class SwiftInstance {
2020

21-
/**
22-
* The designated constructor of any imported Swift types.
23-
*
24-
* @param arena the arena this object belongs to. When the arena goes out of scope, this value is destroyed.
25-
*/
26-
protected SwiftInstance(SwiftArena arena) {
27-
arena.register(this);
28-
}
21+
// TODO: make this a flagset integer and/or use a field updater
22+
/** Used to track additional state of the underlying object, e.g. if it was explicitly destroyed. */
23+
private final AtomicBoolean $state$destroyed = new AtomicBoolean(false);
2924

3025
/**
3126
* Pointer to the {@code self} of the underlying Swift object or value.

0 commit comments

Comments
 (0)