Compare commits

..

No commits in common. "acb0ab1cd7796457b9d2931dfc32976851dc91a0" and "16954695dd6ebdba379c4d5bdfafa5e67e3c8971" have entirely different histories.

4 changed files with 3 additions and 11 deletions

View File

@ -30,7 +30,7 @@ void heap_thread()
{
CPU::disable_interrupts();
dump_heap_usage();
kdbgln("Kernel uses %lu vm pages", KernelVM::used() / ARCH_PAGE_SIZE);
kdbgln("uses %lu vm pages", KernelVM::used() / ARCH_PAGE_SIZE);
while (true) kernel_sleep(UINT64_MAX);
}

View File

@ -1,10 +1,9 @@
#pragma once
#include <luna/TypeTraits.h>
// Must ALWAYS be called with a power of two as alignment.
template <usize alignment, typename T> constexpr T is_aligned(T value)
{
static_assert(IsPowerOfTwo<usize, alignment>);
static_assert((alignment & (alignment - 1)) == 0);
return (value % alignment == 0);
}
@ -15,7 +14,7 @@ static_assert(is_aligned<4096>(40960u));
// Must ALWAYS be called with a power of two as alignment.
template <usize alignment, typename T> constexpr T align_down(T value)
{
static_assert(IsPowerOfTwo<usize, alignment>);
static_assert((alignment & (alignment - 1)) == 0);
return value - value % alignment;
}

View File

@ -1,6 +1,5 @@
#pragma once
#include <luna/Option.h>
#include <luna/TypeTraits.h>
template <typename T> inline Option<T*> nonnull_or_error(T* ptr)
{
@ -58,8 +57,6 @@ template <typename T> class DoublyLinkedList
{
using Node = DoublyLinkedListNode<T>;
static_assert(IsBaseOf<DoublyLinkedListNode<T>, T>);
public:
void append(T* ptr)
{

View File

@ -1,4 +0,0 @@
#pragma once
template <typename Base, typename Derived> inline constexpr bool IsBaseOf = __is_base_of(Base, Derived);
template <typename T, T value> inline constexpr bool IsPowerOfTwo = (value & (value - 1)) == 0;