summaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_physseg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/vm/vm_physseg.c b/sys/vm/vm_physseg.c
index d9abc4b..1675649 100644
--- a/sys/vm/vm_physseg.c
+++ b/sys/vm/vm_physseg.c
@@ -184,6 +184,11 @@ vm_alloc_pageframe_internal(size_t count)
uintptr_t frame_idx = 0; /* The base index of first free frame */
for (size_t i = last_used_idx; i < bitmap_size*8; ++i) {
+ if (free_count == count) {
+ can_alloc = true;
+ break;
+ }
+
is_free = !bitmap_test_bit(bitmap, i);
if (!is_free) {
@@ -191,11 +196,6 @@ vm_alloc_pageframe_internal(size_t count)
continue;
}
- if (free_count == count) {
- can_alloc = true;
- break;
- }
-
/* Assume free here */
if (frame_idx == 0)
frame_idx = i;