Skip to content

Commit bb48895

Browse files
committed
cleanup
1 parent aec1392 commit bb48895

File tree

4 files changed

+28
-27
lines changed

4 files changed

+28
-27
lines changed

Sources/ExampleSwiftLibrary/MySwiftLibrary.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,6 @@ public class MySwiftClass {
4848
p("\(MySwiftClass.self).cap = \(self.cap)")
4949
let addr = unsafeBitCast(self, to: UInt64.self)
5050
p("initializer done, self = 0x\(String(addr, radix: 16, uppercase: true))")
51-
52-
p(" ty = \(MySwiftClass.self) @ \(ObjectIdentifier(MySwiftClass.self))")
53-
54-
let s = "19ExampleSwiftLibrary02MyB5ClassC"
55-
if let ty = _typeByName(s) {
56-
p("any ty (\(s) = \(ty) @ \(ObjectIdentifier(ty))")
57-
assert(ObjectIdentifier(ty) == ObjectIdentifier(MySwiftClass.self))
58-
} else {
59-
p("any ty (\(s) = @ nil")
60-
}
61-
62-
let s2 = "$s19ExampleSwiftLibrary02MyB5ClassC"
63-
if let ty = _typeByName(s2) {
64-
p("any ty (\(s2) = \(ty) @ \(ObjectIdentifier(ty))")
65-
} else {
66-
p("any ty (\(s2) = @ nil")
67-
}
68-
p("USE THE swift_getTypeByMangledNameInEnvironment -----")
69-
if let ty = _getTypeByMangledNameInEnvironment(s, UInt(s.count), genericEnvironment: nil, genericArguments: nil) {
70-
p("any ty (\(s) = \(ty) @ \(ObjectIdentifier(ty))")
71-
assert(ObjectIdentifier(ty) == ObjectIdentifier(MySwiftClass.self))
72-
} else {
73-
p("any ty (\(s) = @ nil")
74-
}
7551
}
7652

7753
deinit {

SwiftKit/src/main/java/org/swift/swiftkit/MemorySegmentUtils.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2024 Apple Inc. and the Swift.org project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of Swift.org project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
115
package org.swift.swiftkit;
216

317
import java.lang.foreign.MemorySegment;

SwiftKit/src/main/java/org/swift/swiftkit/SwiftMemoryResourceCleanup.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
package org.swift.swiftkit;
1616

1717
import java.lang.foreign.MemorySegment;
18-
import java.lang.foreign.ValueLayout;
19-
20-
import static org.swift.swiftkit.MemorySegmentUtils.setSwiftPointerAddress;
2118

2219
/**
2320
* A Swift memory instance cleanup, e.g. count-down a reference count and destroy a class, or destroy struct/enum etc.

SwiftKit/src/main/java/org/swift/swiftkit/util/PlatformUtils.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2024 Apple Inc. and the Swift.org project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of Swift.org project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
115
package org.swift.swiftkit.util;
216

317
public class PlatformUtils {

0 commit comments

Comments
 (0)