/// An allocation using the always available Bootstrap Allocator.
An allocation using the always available Bootstrap Allocator.
An allocation using the always available Bootstrap Allocator .
unsafe fn alloc_bootstrap(layout: Layout) -> *mut u8 {
	let ptr = &mut ALLOCATOR_INFO.heap[ALLOCATOR_INFO.index] as *mut u8;
	debug!(
		"Allocating {:#X} bytes at {:#X}, index {}",
		layout.size(),
		ptr as usize,
		ALLOCATOR_INFO.index
	);
	if ALLOCATOR_INFO.index + layout.size() >= BOOTSTRAP_HEAP_SIZE {
		panic!("Bootstrap Allocator Overflow! Increase BOOTSTRAP_HEAP_SIZE.");
	}
	// Bump the heap index and align it up to the next BOOTSTRAP_HEAP_ALIGNMENT boundary.
	ALLOCATOR_INFO.index = align_up!(
		ALLOCATOR_INFO.index + layout.size(),
		BOOTSTRAP_HEAP_ALIGNMENT
	);
	ptr
}
unsafe fn alloc_bootstrap ( layout : Layout ) -> * mut u8 { let ptr = & mut ALLOCATOR_INFO . heap [ ALLOCATOR_INFO . index ] as * mut u8 ; debug ! ( " " layout size ( ) ptr as usize ALLOCATOR_INFO index ) ; if ALLOCATOR_INFO . index + layout . size ( ) >= BOOTSTRAP_HEAP_SIZE { panic ! ( " " ) ; } // Bump the heap index and align it up to the next BOOTSTRAP_HEAP_ALIGNMENT boundary. ALLOCATOR_INFO . index = align_up ! ( ALLOCATOR_INFO index layout size ( ) BOOTSTRAP_HEAP_ALIGNMENT ) ; ptr }
An allocation using the always available Bootstrap Allocator.
An allocation using the always available Bootstrap Allocator .
layout
Layout