Skip to content

Commit daac5f2

Browse files
authored
Merge pull request #135 from kkebo/add-export-implementation-to-internal-functions
2 parents fdf2a1f + 72e725b commit daac5f2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Sources/RaspberryPi/Framebuffer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ package struct Framebuffer<Depth: UnsignedInteger>: ~Copyable {
1818
/// The number of pixels of Framebuffer.
1919
private let pixelCount: Int
2020
/// Framebuffer.
21+
@inline(always)
22+
@export(implementation)
2123
package var buffer: MutableSpan<Depth> {
22-
@inline(always)
2324
mutating get { unsafe .init(_unsafeStart: self.baseAddress, count: self.pixelCount) }
2425
}
2526

Sources/RaspberryPi/mbox.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ let mboxEmpty: UInt32 = 0x4000_0000
1515
struct Mbox: ~Copyable {
1616
private var storage: [36 of UInt32] = .init(repeating: 0)
1717

18+
@inline(always)
1819
private mutating func volatilePointer(at i: Int) -> VolatileMappedRegister<UInt32> {
1920
unsafe withUnsafePointer(to: &self.storage[i]) { ptr in
2021
unsafe VolatileMappedRegister(unsafeBitPattern: UInt(bitPattern: ptr))
2122
}
2223
}
2324

2425
@inline(always)
26+
@export(implementation)
2527
subscript(_ i: Int) -> UInt32 {
2628
mutating get { self.volatilePointer(at: i).load() }
2729
set { self.volatilePointer(at: i).store(newValue) }

0 commit comments

Comments
 (0)