Implement free() to finish buddy allocator
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user