(memory_start: ConfidentialMemoryAddress, memory_end: *const usize)
| 86 | #[rr::ensures(#iris "once_initialized π \"PAGE_ALLOCATOR\" (Some ())")] |
| 87 | #[rr::returns("Ok(())")] |
| 88 | pub unsafe fn initialize(memory_start: ConfidentialMemoryAddress, memory_end: *const usize) -> Result<(), Error> { |
| 89 | ensure_not!(PAGE_ALLOCATOR.is_completed(), Error::Reinitialization())?; |
| 90 | let mut page_allocator = Self::empty(); |
| 91 | unsafe { page_allocator.add_memory_region(memory_start, memory_end)? }; |
| 92 | PAGE_ALLOCATOR.call_once( |
| 93 | #[rr::verify] |
| 94 | || RwLock::new(page_allocator), |
| 95 | ); |
| 96 | Ok(()) |
| 97 | } |
| 98 | |
| 99 | /// Specification: |
| 100 | /// Postcondition: an initialized memory allocator is returned |
nothing calls this directly
no test coverage detected