Format code

This commit is contained in:
Arthur Beck 2025-02-21 06:46:21 -06:00
parent 7bb8a99b56
commit ef93327e6b
Signed by: ArthurB
GPG key ID: ACE3D14F5CEF14BF
2 changed files with 7 additions and 3 deletions

View file

@ -40,7 +40,9 @@ fn main() {
println!(r#"cargo:rustc-check-cfg=cfg(CONFIG_BUILD_GRUB, values("true", "false", none()))"#); println!(r#"cargo:rustc-check-cfg=cfg(CONFIG_BUILD_GRUB, values("true", "false", none()))"#);
println!(r#"cargo:rustc-check-cfg=cfg(CONFIG_MEMORY_UNION_ALL, values("true", "false", none()))"#); println!(
r#"cargo:rustc-check-cfg=cfg(CONFIG_MEMORY_UNION_ALL, values("true", "false", none()))"#
);
// End checks // End checks
// Configuration name used when a config is required but should always evaluate to true // Configuration name used when a config is required but should always evaluate to true

View file

@ -78,14 +78,16 @@ fn get_allocator() -> Option<&'static MemoryMapAlloc<'static>> {
/// The unsafe counterpart of [MemMapAlloc()]. Doesn't check if the allocator is initalized. /// The unsafe counterpart of [MemMapAlloc()]. Doesn't check if the allocator is initalized.
/// Internally, uses [MaybeUninit::assume_init_ref]. /// Internally, uses [MaybeUninit::assume_init_ref].
/// ///
/// # Safety /// # Safety
/// ///
/// Calling this instead of [MemMapAlloc] or when the allocator is uninitalized causes /// Calling this instead of [MemMapAlloc] or when the allocator is uninitalized causes
/// undefined behavior; check [MaybeUninit::assume_init_ref] for safety guarantees. /// undefined behavior; check [MaybeUninit::assume_init_ref] for safety guarantees.
pub unsafe fn get_allocator_unchecked() -> &'static MemoryMapAlloc<'static> { pub unsafe fn get_allocator_unchecked() -> &'static MemoryMapAlloc<'static> {
#[allow(static_mut_refs)] #[allow(static_mut_refs)]
unsafe { ALLOCATOR.assume_init_ref() } unsafe {
ALLOCATOR.assume_init_ref()
}
} }
#[kernel_item(MemMapAllocInit)] #[kernel_item(MemMapAllocInit)]