This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// A friendly wrapper around `setiopolicy_np`. | |
| public enum IOPolicies { | |
| case DontResolveSymlinks | |
| case DiskIONormal | |
| case DiskIOPassive | |
| case DiskIOThrottled | |
| case DiskIOImportant | |
| case MaterializeVirtualFiles | |
| case DontMaterializeVirtualFiles | |
| case BackgroundIOImportant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fileprivate final class MixenAppDelegate: NSObject, UIApplicationDelegate, MXMetricManagerSubscriber { | |
| nonisolated let registered = AtomicBool() | |
| func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { | |
| // Get this out of the critial path of startup, or we will get passed metrics packets to | |
| // process before the main UI is on-screen | |
| if OnboardingState.initial.isReadyForUse { | |
| DispatchQueue.global(qos: .background).asyncAfter(deadline: .now() + 75) { | |
| self.register() | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| We generate two implementations for each integer type (optionally including UInt128, which won't compile | |
| on MacOS < 15, so it's not there by default), including size_t and ptrdiff_t (aka Rust's isize): | |
| * SwiftAtomic$TYPE - A class type which owns the allocation and implements SwiftAtomicInteger | |
| * Atomic$TYPEPointer - A struct which consumes an UnsafeMutablePointer<$TYPE> and does *not* involve a | |
| reference-counted class type (but the code that instantiates it is entirely responsible for ensuring | |
| the pointee is not dropped, and for explicitly dropping it in deinit) | |
| For the second, it would be nicer to implement IntegerAtomic *directly* on UnsafeMutablePointer, but Swift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// An atomic reference to an object. | |
| public final class SwiftAtomicReference<T : AnyObject> : @unchecked Sendable where T: Sendable { | |
| private let pointer: UnsafeMutablePointer<size_t> | |
| public var value : T { | |
| get { | |
| load() | |
| } set(val) { | |
| store(val) | |
| } |
OlderNewer