Skip to content

Commit

Permalink
ci: update workflow actions location
Browse files Browse the repository at this point in the history
  • Loading branch information
marcprux committed Mar 27, 2024
1 parent 4c99123 commit f5ea1f8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ permissions:

jobs:
call-workflow:
uses: skiptools/skip/.github/workflows/skip-framework.yml@main
uses: skiptools/actions/.github/workflows/skip-framework.yml@main
1 change: 1 addition & 0 deletions SkipLink/SkipFFI
1 change: 1 addition & 0 deletions SkipLink/SkipFFITests
17 changes: 17 additions & 0 deletions Sources/SkipFFI/SkipFFI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,24 @@ extension Data {
let ptr = com.sun.jna.Native.getDirectBufferPointer(buf)
return body(com.sun.jna.ptr.PointerByReference(ptr))
}

public mutating func withUnsafeMutableBytes<ResultType>(_ body: (UnsafeRawBufferPointer) throws -> ResultType) rethrows -> ResultType {
let byteArray = self.kotlin(nocopy: true)
let len = self.count
let buf = java.nio.ByteBuffer.allocateDirect(len)
buf.put(byteArray)
//buf.flip()
let ptr = com.sun.jna.Native.getDirectBufferPointer(buf)
let ptrRef = com.sun.jna.ptr.PointerByReference(ptr)
let result = body(ptrRef)


let byteArray2 = PlatformData(len)
ptrRef.value.read(0, byteArray2, 0, len)
return result
}
}
internal typealias PlatformData = kotlin.ByteArray

#endif

Expand Down

0 comments on commit f5ea1f8

Please sign in to comment.