Convert page_block to use kutil::linked_list

- Created a new linked_list-based slab allocator
- Simplified memory bootstrap code by using the slab allocator and
  linked_lists
This commit is contained in:
Justin C. Miller
2018-09-11 20:46:48 -07:00
parent d5c44645eb
commit 593cda3ee8
9 changed files with 427 additions and 405 deletions

View File

@@ -0,0 +1,19 @@
#pragma once
#include <atomic>
namespace kutil {
class spinlock
{
public:
spinlock() : m_lock(false) {}
inline void enter() { while (!m_lock.exchange(true)); }
inline void leave() { m_lock.store(false); }
private:
std::atomic<bool> m_lock;
};
} // namespace kutil