(self)
| 76 | /// It is undefined behavior to reference the ptr in any other context after this. |
| 77 | #[track_caller] |
| 78 | pub fn take(self) -> Box<T> { |
| 79 | trace!("{:?}::take", self); |
| 80 | assert_ne!( |
| 81 | self.ptr, |
| 82 | 0, |
| 83 | "cannot deref null for &{}", |
| 84 | any::type_name::<T>() |
| 85 | ); |
| 86 | let obj = self.ptr as *mut T; |
| 87 | |
| 88 | unsafe { Box::from_raw(obj) } |
| 89 | } |
| 90 | |
| 91 | /// Take ownership of a Rust type and return an opaque pointer as a jlong for future usage |
| 92 | pub fn make_opaque(self) -> jlong { |
no outgoing calls
no test coverage detected