Added InlineArray pattern overloads to the library to optimize for macOS 26.

This commit is contained in:
2026-09-18 12:30:54 +02:00
parent 52d5d2ec42
commit c9f887bacb
4 changed files with 75 additions and 0 deletions
+6
View File
@@ -36,6 +36,8 @@ enum Mock {
nonisolated(unsafe) static var buttonState: (current: UInt32, pushed: UInt32, released: UInt32) = (0, 0, 0)
/// The 16 bytes behind the last pattern `LCDColor` seen by a stub.
nonisolated(unsafe) static var patternBytes: [UInt8] = []
/// The 8 rows last handed to `setStencilPattern`.
nonisolated(unsafe) static var stencilRows: [UInt8] = []
/// Caps the bytes a file read returns (0 = end of file, negative =
/// error); `nil` fills the whole request.
nonisolated(unsafe) static var fileReadLimit: Int32?
@@ -90,6 +92,7 @@ enum Mock {
events = []
buttonState = (0, 0, 0)
patternBytes = []
stencilRows = []
fileReadLimit = nil
tilesPointer = nil
tilesCount = 0
@@ -246,6 +249,9 @@ enum Mock {
Mock.record("newSprite")
return Mock.fakePointer()
}
spriteAPI.pointee.setStencilPattern = { _, pattern in
Mock.stencilRows = Array(UnsafeBufferPointer(start: pattern, count: 8))
}
spriteAPI.pointee.freeSprite = { _ in
Mock.record("freeSprite")
}