Implement free() to finish buddy allocator

This commit is contained in:
Justin C. Miller
2018-05-07 00:59:45 -07:00
parent 949c9c0b8c
commit abb347e1a8
5 changed files with 126 additions and 52 deletions

View File

@@ -19,4 +19,10 @@ inline T * offset_pointer(T *p, size_t offset)
return reinterpret_cast<T *>(reinterpret_cast<addr_t>(p) + offset);
}
template <typename T>
inline T* mask_pointer(T *p, addr_t mask)
{
return reinterpret_cast<T *>(reinterpret_cast<addr_t>(p) & ~mask);
}
} // namespace kutil