@@ -52,7 +52,10 @@ use align_address::Align;
5252use free_list:: { PageLayout , PageRange } ;
5353use hermit_sync:: { Lazy , RawInterruptTicketMutex } ;
5454pub use memory_addresses:: { PhysAddr , VirtAddr } ;
55- use talc:: { ErrOnOom , Span , Talc , Talck } ;
55+ #[ cfg( target_os = "none" ) ]
56+ use talc:: TalcLock ;
57+ #[ cfg( target_os = "none" ) ]
58+ use talc:: source:: Manual ;
5659
5760pub use self :: page_range_alloc:: { PageRangeAllocator , PageRangeBox } ;
5861pub use self :: physicalmem:: { FrameAlloc , FrameBox } ;
@@ -65,7 +68,7 @@ use crate::{arch, env};
6568
6669#[ cfg( target_os = "none" ) ]
6770#[ global_allocator]
68- pub ( crate ) static ALLOCATOR : Talck < RawInterruptTicketMutex , ErrOnOom > = Talc :: new ( ErrOnOom ) . lock ( ) ;
71+ pub ( crate ) static ALLOCATOR : TalcLock < RawInterruptTicketMutex , Manual > = TalcLock :: new ( Manual ) ;
6972
7073/// Physical and virtual address range of the 2 MiB pages that map the kernel.
7174static KERNEL_ADDR_RANGE : Lazy < Range < VirtAddr > > = Lazy :: new ( || {
@@ -277,9 +280,12 @@ pub(crate) fn init() {
277280
278281 let heap_end_addr = map_addr;
279282
280- let arena = Span :: new ( heap_start_addr . as_mut_ptr ( ) , heap_end_addr . as_mut_ptr ( ) ) ;
283+ let size = heap_end_addr . as_usize ( ) - heap_start_addr . as_usize ( ) ;
281284 unsafe {
282- ALLOCATOR . lock ( ) . claim ( arena) . unwrap ( ) ;
285+ ALLOCATOR
286+ . lock ( )
287+ . claim ( heap_start_addr. as_mut_ptr ( ) , size)
288+ . unwrap ( ) ;
283289 }
284290
285291 info ! ( "Heap is located at {heap_start_addr:p}..{heap_end_addr:p} ({map_size} Bytes unmapped)" ) ;
0 commit comments