diff --git a/kernel/src/memory/MemoryMap.cpp b/kernel/src/memory/MemoryMap.cpp index cf83a67a..8743e83c 100644 --- a/kernel/src/memory/MemoryMap.cpp +++ b/kernel/src/memory/MemoryMap.cpp @@ -35,13 +35,13 @@ void MemoryMapIterator::rewind() m_cur_ent = 0; } -Result MemoryMapIterator::at(usize index) const +Option MemoryMapIterator::at(usize index) const { - if (index >= m_mmap_entries) return err(ERANGE); + if (index >= m_mmap_entries) return {}; return memory_map_entry_from_mmapent(m_base_ent + index); } -Result MemoryMapIterator::next() +Option MemoryMapIterator::next() { return at(m_cur_ent++); } diff --git a/kernel/src/memory/MemoryMap.h b/kernel/src/memory/MemoryMap.h index 4c53bde4..669b07aa 100644 --- a/kernel/src/memory/MemoryMap.h +++ b/kernel/src/memory/MemoryMap.h @@ -44,13 +44,13 @@ class MemoryMapIterator void rewind(); - Result next(); + Option next(); MemoryMapEntry largest_free(); MemoryMapEntry highest(); - Result at(usize index) const; + Option at(usize index) const; usize entries() const {