Skip to content

Commit a0b8466

Browse files
committed
rename cleanup create function to $ func as well
1 parent 57c489b commit a0b8466

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void close() {
6060
public void register(SwiftInstance instance) {
6161
checkValid();
6262

63-
SwiftInstanceCleanup cleanup = instance.createCleanupAction();
63+
SwiftInstanceCleanup cleanup = instance.$createCleanup();
6464
this.resources.add(cleanup);
6565
}
6666

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ protected SwiftInstance(SwiftArena arena) {
4141
* <p/>
4242
* <b>Warning:</b> The cleanup action must not capture {@code this}.
4343
*/
44-
public abstract SwiftInstanceCleanup createCleanupAction();
45-
46-
// TODO: make this a flagset integer and/or use a field updater
47-
/** Used to track additional state of the underlying object, e.g. if it was explicitly destroyed. */
48-
private final AtomicBoolean $state$destroyed = new AtomicBoolean(false);
44+
public abstract SwiftInstanceCleanup $createCleanup();
4945

5046
/**
5147
* Exposes a boolean value which can be used to indicate if the object was destroyed.

SwiftKitFFM/src/main/java/org/swift/swiftkit/ffm/AllocatingAutoSwiftMemorySession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void register(SwiftInstance instance) {
5656

5757
// We make sure we don't capture `instance` in the
5858
// cleanup action, so we can ignore the warning below.
59-
var cleanupAction = instance.createCleanupAction();
59+
var cleanupAction = instance.$createCleanup();
6060
cleaner.register(instance, cleanupAction);
6161
}
6262

SwiftKitFFM/src/main/java/org/swift/swiftkit/ffm/FFMSwiftInstance.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected FFMSwiftInstance(MemorySegment segment, AllocatingSwiftArena arena) {
5252

5353

5454
@Override
55-
public SwiftInstanceCleanup createCleanupAction() {
55+
public SwiftInstanceCleanup $createCleanup() {
5656
var statusDestroyedFlag = $statusDestroyedFlag();
5757
Runnable markAsDestroyed = () -> statusDestroyedFlag.set(true);
5858

0 commit comments

Comments
 (0)