PMM - alloc zero after all free pages
This commit is contained in:
parent
9b930ae5d3
commit
e7bdea771b
@ -9,5 +9,7 @@ void pmm_free(void *c)
|
||||
|
||||
void *pmm_alloc()
|
||||
{
|
||||
return first;
|
||||
void *c = first;
|
||||
first = 0;
|
||||
return c;
|
||||
}
|
||||
|
@ -18,3 +18,10 @@ TEST(alloc_returns_0_if_no_free_pages)
|
||||
void *a = pmm_alloc();
|
||||
ASSERT_EQ_PTR(a, 0);
|
||||
}
|
||||
TEST(alloc_zero_after_all_free_pages)
|
||||
{
|
||||
pmm_free(&mem[0]);
|
||||
pmm_alloc();
|
||||
void *a = pmm_alloc();
|
||||
ASSERT_EQ_PTR(a, 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user