Skip to content

Commit cda3fa6

Browse files
authored
Delete the __dso_handle definition. (#37)
This is the first step of moving `__dso_handle` into Mustang, which is where we're going for C ABI compatibility.
1 parent 2d9ba03 commit cda3fa6

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

src/lib.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -124,30 +124,6 @@ pub unsafe fn start(mem: *mut usize) -> ! {
124124
program::entry(mem)
125125
}
126126

127-
/// An ABI-conforming `__dso_handle`.
128-
#[cfg(feature = "origin-program")]
129-
#[cfg(feature = "origin-start")]
130-
#[no_mangle]
131-
static __dso_handle: UnsafeSendSyncVoidStar =
132-
UnsafeSendSyncVoidStar(&__dso_handle as *const _ as *const _);
133-
134-
/// A type for `__dso_handle`.
135-
///
136-
/// `*const c_void` isn't `Send` or `Sync` because a raw pointer could point to
137-
/// arbitrary data which isn't thread-safe, however `__dso_handle` is used as
138-
/// an opaque cookie value, and it always points to itself.
139-
///
140-
/// Note that in C, `__dso_handle`'s type is usually `void *` which would
141-
/// correspond to `*mut c_void`, however we can assume the pointee is never
142-
/// actually mutated.
143-
#[cfg(feature = "origin-program")]
144-
#[repr(transparent)]
145-
struct UnsafeSendSyncVoidStar(*const core::ffi::c_void);
146-
#[cfg(feature = "origin-program")]
147-
unsafe impl Send for UnsafeSendSyncVoidStar {}
148-
#[cfg(feature = "origin-program")]
149-
unsafe impl Sync for UnsafeSendSyncVoidStar {}
150-
151127
/// Initialize logging, if enabled.
152128
#[cfg(feature = "log")]
153129
#[link_section = ".init_array.00099"]

0 commit comments

Comments
 (0)