optimize page alloc

Signed-off-by: ablechen <17895010372@163.com>
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
This commit is contained in:
Wang Chen
2022-11-23 10:39:41 +08:00
parent 744226d09e
commit c674ffc9bc
10 changed files with 20 additions and 20 deletions

View File

@@ -117,8 +117,8 @@ void *page_alloc(int npages)
* meet a free page, continue to check if following
* (npages - 1) pages are also unallocated.
*/
struct Page *page_j = page_i;
for (int j = i; j < (i + npages); j++) {
struct Page *page_j = page_i + 1;
for (int j = i + 1; j < (i + npages); j++) {
if (!_is_free(page_j)) {
found = 0;
break;