@@ -39,6 +39,7 @@ impl Segment {
3939 }
4040
4141 fn set_rw ( & mut self ) {
42+ #[ cfg( not( target_os = "uefi" ) ) ]
4243 unsafe {
4344 region:: protect ( self . ptr , self . len , region:: Protection :: READ_WRITE )
4445 . expect ( "unable to change memory protection for jit memory segment" ) ;
@@ -56,6 +57,7 @@ impl Segment {
5657 super :: set_readable_and_executable ( self . ptr , self . len , branch_protection)
5758 . expect ( "unable to set memory protection for jit memory segment" ) ;
5859 } else {
60+ #[ cfg( not( target_os = "uefi" ) ) ]
5961 unsafe {
6062 region:: protect ( self . ptr , self . len , self . target_prot )
6163 . expect ( "unable to change memory protection for jit memory segment" ) ;
@@ -93,6 +95,7 @@ impl Segment {
9395/// Note: Memory will be leaked by default unless
9496/// [`JITMemoryProvider::free_memory`] is called to ensure function pointers
9597/// remain valid for the remainder of the program's life.
98+ #[ cfg( not( target_os = "uefi" ) ) ]
9699pub struct ArenaMemoryProvider {
97100 alloc : ManuallyDrop < Option < region:: Allocation > > ,
98101 ptr : * mut u8 ,
@@ -101,8 +104,10 @@ pub struct ArenaMemoryProvider {
101104 segments : Vec < Segment > ,
102105}
103106
107+ #[ cfg( not( target_os = "uefi" ) ) ]
104108unsafe impl Send for ArenaMemoryProvider { }
105109
110+ #[ cfg( not( target_os = "uefi" ) ) ]
106111impl ArenaMemoryProvider {
107112 /// Create a new memory region with the given size.
108113 pub fn new_with_size ( reserve_size : usize ) -> Result < Self , region:: Error > {
@@ -206,6 +211,7 @@ impl ArenaMemoryProvider {
206211 }
207212}
208213
214+ #[ cfg( not( target_os = "uefi" ) ) ]
209215impl Drop for ArenaMemoryProvider {
210216 fn drop ( & mut self ) {
211217 if self . ptr == ptr:: null_mut ( ) {
@@ -220,6 +226,7 @@ impl Drop for ArenaMemoryProvider {
220226 }
221227}
222228
229+ #[ cfg( not( target_os = "uefi" ) ) ]
223230impl JITMemoryProvider for ArenaMemoryProvider {
224231 fn allocate ( & mut self , size : usize , align : u64 , kind : JITMemoryKind ) -> io:: Result < * mut u8 > {
225232 self . allocate_inner (
0 commit comments