aboutsummaryrefslogtreecommitdiff
path: root/kernel/src/memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/memory.cpp')
-rw-r--r--kernel/src/memory.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/src/memory.cpp b/kernel/src/memory.cpp
index 3bc86f3..0f614f0 100644
--- a/kernel/src/memory.cpp
+++ b/kernel/src/memory.cpp
@@ -6,6 +6,8 @@
#include "kernel/memory/block_list_allocator.hpp"
#include "kernel/memory/heap_allocator.hpp"
+#include <kstd/print>
+
#include <atomic>
#include <cstddef>
#include <new>
@@ -22,10 +24,14 @@ namespace kernel::memory
[[nodiscard]] auto allocate(std::size_t, std::align_val_t) noexcept -> void * override
{
+ kstd::print(kstd::print_sink::stderr, "Tried to allocate memory without an active heap!");
return nullptr;
}
- auto deallocate(void *) noexcept -> void override {}
+ auto deallocate(void *) noexcept -> void override
+ {
+ kstd::print(kstd::print_sink::stderr, "Tried to deallocate memory without an active heap!");
+ }
};
constinit null_allocator null_allocator::instance{};
@@ -45,11 +51,12 @@ namespace kernel::memory
if (is_initialized.test_and_set())
{
- kapi::system::panic("[OS] The heap has already been initialized.");
+ kapi::system::panic("[OS:MEM] The heap has already been initialized.");
}
auto & instance = basic_allocator.emplace(base);
active_heap_allocator = &instance;
+ kstd::println("[OS:MEM] Heap initialized. Dynamic memory available.");
}
} // namespace kernel::memory \ No newline at end of file