refactor(macos-gpu): use the new cfTypeRefToZigString function instead of the old cfStringToZigString

This commit is contained in:
utox39
2025-08-25 02:09:52 +02:00
parent 092171ef7f
commit 27995745e4

View File

@@ -236,7 +236,7 @@ pub fn getGpuInfo(allocator: std.mem.Allocator) !GpuInfo {
if (c_iokit.CFDictionaryGetValueIfPresent(@as(c_iokit.CFDictionaryRef, @ptrCast(properties_ptr)), model_key, &name_ref) == c_iokit.TRUE) { if (c_iokit.CFDictionaryGetValueIfPresent(@as(c_iokit.CFDictionaryRef, @ptrCast(properties_ptr)), model_key, &name_ref) == c_iokit.TRUE) {
if (c_iokit.CFGetTypeID(name_ref) == c_iokit.CFStringGetTypeID()) { if (c_iokit.CFGetTypeID(name_ref) == c_iokit.CFStringGetTypeID()) {
const accel_name = utils.cfStringToZigString(allocator, @as(c_iokit.CFStringRef, @ptrCast(name_ref))) catch { const accel_name = utils.cfTypeRefToZigString(allocator, name_ref) catch {
return gpu_info; return gpu_info;
}; };