sandbox: vm: add cache allocator, generic size-N caches for kmalloc()

This commit is contained in:
2023-02-02 16:58:48 +00:00
parent 3c781a4cb3
commit 662be5ec1f
4 changed files with 312 additions and 14 deletions

View File

@@ -174,9 +174,6 @@ int memory_test(void)
print_free_pages(&pg_data->pg_zones[i]);
}
printf("all pages:\n");
print_all_pages();
vm_page_t *pg = vm_page_alloc(VM_PAGE_128K, 0);
printf("allocated 128K at 0x%lx\n", vm_page_get_paddr(pg));
@@ -242,6 +239,9 @@ int memory_test(void)
}
}
void *p = kmalloc(32, 0);
printf("allocated 32 bytes at %p\n", p);
munmap(system_memory, MB_TO_BYTES(MEMORY_SIZE_MB));
return 0;
}