macOS: fix Sendable warning for UnsafeMutablePointer

Swift explicitly [marked UnsafeMutablePointer as non sendable](0568dbf903). Moving from `@unchecked @retroactive` to `nonisolated(unsafe)` is safe for us as per the previous comments
This commit is contained in:
Lukas
2026-07-23 22:13:51 +02:00
parent 396166ecbe
commit da8b171265
3 changed files with 6 additions and 9 deletions

View File

@@ -6,7 +6,9 @@ extension Ghostty {
///
/// Wraps a `ghostty_inspector_t`
final class Inspector: Sendable {
private let inspector: ghostty_inspector_t
/// A inspector is sendable because it is just a reference type. Using the inspector in parameters
/// may be unsafe but the value itself is safe to send across threads.
nonisolated(unsafe) private let inspector: ghostty_inspector_t
/// Read the underlying C value for this inspector. This is unsafe because the value will be
/// freed when the Inspector class is deinitialized.

View File

@@ -10,7 +10,9 @@ extension Ghostty {
///
/// Wraps a `ghostty_surface_t`
final class Surface: Sendable {
private let surface: ghostty_surface_t
/// A surface is sendable because it is just a reference type. Using the surface in parameters
/// may be unsafe but the value itself is safe to send across threads.
nonisolated(unsafe) private let surface: ghostty_surface_t
/// Read the underlying C value for this surface. This is unsafe because the value will be
/// freed when the Surface class is deinitialized.

View File

@@ -4,13 +4,6 @@ import GhosttyKit
// MARK: C Extensions
/// A command is fully self-contained so it is Sendable.
extension ghostty_command_s: @unchecked @retroactive Sendable {}
/// A surface is sendable because it is just a reference type. Using the surface in parameters
/// may be unsafe but the value itself is safe to send across threads.
extension ghostty_surface_t: @unchecked @retroactive Sendable {}
extension Ghostty {
// The user notification category identifier
static let userNotificationCategory = "com.mitchellh.ghostty.userNotification"