From ba806aed15a5288426b80eeb62f85cc4c95b2352 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 20 Sep 2023 16:50:29 +0200 Subject: [PATCH] tmp --- crates/objc2/src/declare/ivar.rs | 1 + crates/objc2/src/runtime/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/objc2/src/declare/ivar.rs b/crates/objc2/src/declare/ivar.rs index 0a229edb7..05d2acfcd 100644 --- a/crates/objc2/src/declare/ivar.rs +++ b/crates/objc2/src/declare/ivar.rs @@ -94,6 +94,7 @@ pub unsafe trait IvarType { #[doc(hidden)] unsafe fn __offset(ptr: NonNull) -> isize { let obj = unsafe { ptr.as_ref() }; + std::println!("get offset: {ptr:?}"); ivar_offset(obj.class(), Self::NAME, &Self::Type::ENCODING) } } diff --git a/crates/objc2/src/runtime/mod.rs b/crates/objc2/src/runtime/mod.rs index 0ad0df73b..a7fa855b4 100644 --- a/crates/objc2/src/runtime/mod.rs +++ b/crates/objc2/src/runtime/mod.rs @@ -1002,6 +1002,7 @@ impl fmt::Display for AnyProtocol { } pub(crate) fn ivar_offset(cls: &AnyClass, name: &str, expected: &Encoding) -> isize { + std::println!("get offset of cls: {cls:?}"); match cls.instance_variable(name) { Some(ivar) => { let encoding = ivar.type_encoding();