1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 06:27:35 +00:00

AK: Rename KB, MB, GB to KiB, MiB, GiB

The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9".
The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30".

Let's use the correct name, at least in code.

Only changes the name of the constants, no other behavior change.
This commit is contained in:
Nico Weber 2020-08-15 13:55:00 -04:00 committed by Andreas Kling
parent a68650a7b4
commit 430b265cd4
31 changed files with 69 additions and 69 deletions

View file

@ -101,8 +101,8 @@ void MemoryManager::parse_memory_map()
if (mmap->type != MULTIBOOT_MEMORY_AVAILABLE)
continue;
// FIXME: Maybe make use of stuff below the 1MB mark?
if (mmap->addr < (1 * MB))
// FIXME: Maybe make use of stuff below the 1MiB mark?
if (mmap->addr < (1 * MiB))
continue;
if ((mmap->addr + mmap->len) > 0xffffffff)
@ -131,9 +131,9 @@ void MemoryManager::parse_memory_map()
for (size_t page_base = mmap->addr; page_base < (mmap->addr + mmap->len); page_base += PAGE_SIZE) {
auto addr = PhysicalAddress(page_base);
if (page_base < 7 * MB) {
if (page_base < 7 * MiB) {
// nothing
} else if (page_base >= 7 * MB && page_base < 8 * MB) {
} else if (page_base >= 7 * MiB && page_base < 8 * MiB) {
if (region.is_null() || !region_is_super || region->upper().offset(PAGE_SIZE) != addr) {
m_super_physical_regions.append(PhysicalRegion::create(addr, addr));
region = m_super_physical_regions.last();