1 use gimli
::{EndianSlice, NativeEndian, Pointer}
;
3 pub type StaticSlice
= EndianSlice
<'
static, NativeEndian
>;
5 pub unsafe fn get_unlimited_slice
<'a
>(start
: *const u8) -> &'a
[u8] {
6 // Create the largest possible slice for this address.
7 let start
= start
as usize;
8 let end
= start
.saturating_add(isize::MAX
as _
);
10 unsafe { core::slice::from_raw_parts(start as *const _, len) }
13 pub unsafe fn deref_pointer(ptr
: Pointer
) -> usize {
15 Pointer
::Direct(x
) => x
as _
,
16 Pointer
::Indirect(x
) => unsafe { *(x as *const _) }
,
20 #[cfg(feature = "libc")]
23 #[cfg(not(feature = "libc"))]
24 #[allow(non_camel_case_types)]
28 any(feature
= "panic", feature
= "panic-handler-dummy"),
32 unsafe { libc::abort() }
;
36 any(feature
= "panic", feature
= "panic-handler-dummy"),
40 core
::intrinsics
::abort();