PMM -- Fix type for pointer to next block

This commit is contained in:
Thomas Lovén 2017-12-21 16:25:59 +01:00
parent 82fbafc38e
commit 28916257f1

View File

@ -4,15 +4,15 @@ uintptr_t *first = 0;
void pmm_free(void *c) void pmm_free(void *c)
{ {
c = (uintptr_t *)P2V(c); c = (void *)P2V(c);
*(uintptr_t *)c = (uintptr_t)first; *(uintptr_t **)c = first;
first = c; first = c;
} }
void *pmm_alloc() void *pmm_alloc()
{ {
void *c = first; void *c = first;
first = (uintptr_t *)(c?*(uintptr_t *)c:0); first = c?*(uintptr_t **)c:0;
c = (uintptr_t *)V2P(c); c = (void *)V2P(c);
return c; return c;
} }