I want to pass a uintptr to unsafe.Pointer but govet is telling me possible misuse of unsafe.Pointer. I can't figure out how to satisfy govet. If i ...
I want to pass a uintptr to unsafe.Pointer but govet is telling me possible misuse of unsafe.Pointer. I can't figure out how to satisfy govet. If i ...
How do you convert an UnsafeMutablePointer to a Data object? ...
I would like to create a Rust semaphore wrapping the libc sem_post and sem_wait functions, both of which take a mutable int * parameter. This requires ...
I would like to write some unsafe C# code for the purpose of writing high-performance, low-level libraries. But I don't quite understand the limitati ...
For example, without this second overload, loading an Array will yield "UnsafeRawBufferPointer.load out of bounds". Is there a way to handle both case ...
Are unsafe.Pointer()s reference counted and thus protected from being garbage collected? As in, if I have a string, it exists while it's in scope, if ...
I think this is more a pointer question than a VideoToolbox session. I'm trying to do something similar to How to calculate FPS of Hardware Decode on ...
I understand that usage of unsafe package of golang is unsafe, but I'm doing it only for education purposes. The idea is to copy a slice field of str ...
I got this code here from an app I am working on. I inherited this code when the BLE guy left the team. I am not good with low level stuff and Data st ...
I am looking a better way to convert a hex string to an array of UnsafePointer. here is my current code: I'm porting a C++ class to Swift and this ...
The following code doesn't pass the borrow checker, for Label-A uses a value that consumed by Label-B, but the code is actually safe: the Label-A is g ...
I've been working quite a bit with Apple's neural net tools, which means I've been working quite a bit with unsafe pointers. I grew up with C, and I'v ...
When generating a CGImage one can choose between an initializer using JPEG-encoded data, PNG-encoded data or just data. I'm generating an image from a ...
I have been working on an app that uses Pencil Kit and I am trying to store a drawing on the canvas into a sqlite3 database. In order to do so, I had ...
On .Net Core 3.1, I have many large 2D arrays where I need to operate on a slice of a single row in the array. The same slice may be used by multiple ...
I am trying to call a C function from Swift One of the arguments to the C function is defined as the type: const char * const * i_argv In Xcode aut ...
Document said: An in-out expression that contains a mutable variable, property, or subscript reference of type Type, which is passed as a pointer ...
In Swift I want to pass a data buffer (named data) of type Data to a C function (named do_something) that takes a pointer of type UnsafePointer<UIn ...
What I Have: Referencing Apple's Chroma Key Code, it states that we can create a Chroma Key Filter Cube via I then created a function to be able t ...
I have a question about a code that I use. If we look at the line: Here I assign the 5th index in the array2D to the pointer fixedInput. Complete ...