aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2024-11-24 15:19:29 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-11-24 15:19:29 +0000
commiteada7bbb150fd81e6fbf71b1df28c8dc19393cfa (patch)
tree2abba80305b51b30ab22b4b7a0abe8b2403e2517 /arch/x86_64
parent82cfe7fe12626a3bdf1bdf9efcbc7911051ebddf (diff)
downloadteachos-eada7bbb150fd81e6fbf71b1df28c8dc19393cfa.tar.xz
teachos-eada7bbb150fd81e6fbf71b1df28c8dc19393cfa.zip
Adjust bump allocator comment
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/include/arch/memory/heap/bump_allocator.hpp3
-rw-r--r--arch/x86_64/src/kernel/main.cpp2
-rw-r--r--arch/x86_64/src/memory/heap/bump_allocator.cpp2
3 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86_64/include/arch/memory/heap/bump_allocator.hpp b/arch/x86_64/include/arch/memory/heap/bump_allocator.hpp
index 5b581ba..d31783d 100644
--- a/arch/x86_64/include/arch/memory/heap/bump_allocator.hpp
+++ b/arch/x86_64/include/arch/memory/heap/bump_allocator.hpp
@@ -6,7 +6,8 @@
namespace teachos::arch::memory::heap
{
/**
- * @brief Simple heap allocator, which leaks all allocated memory, because it does not really deallocate anything.
+ * @brief Simple heap allocator, which allocates linearly and leaks all allocated memory, because it does not really
+ * deallocate anything.
*/
struct bump_allocator
{
diff --git a/arch/x86_64/src/kernel/main.cpp b/arch/x86_64/src/kernel/main.cpp
index f4eb033..13526f4 100644
--- a/arch/x86_64/src/kernel/main.cpp
+++ b/arch/x86_64/src/kernel/main.cpp
@@ -31,5 +31,7 @@ namespace teachos::arch::kernel
// allocator.allocate_frame still works?
// TODO: Fix unmapping old level 4 page table and turn it into guard page, use Stack Probes for stack allocation if
// possible.
+
+ // TODO: Align up and down for the bump allocator. https://os.phil-opp.com/kernel-heap/#a-bump-allocator
}
} // namespace teachos::arch::kernel
diff --git a/arch/x86_64/src/memory/heap/bump_allocator.cpp b/arch/x86_64/src/memory/heap/bump_allocator.cpp
index 486ece8..1ab8ea9 100644
--- a/arch/x86_64/src/memory/heap/bump_allocator.cpp
+++ b/arch/x86_64/src/memory/heap/bump_allocator.cpp
@@ -6,8 +6,6 @@ namespace teachos::arch::memory::heap
{
auto bump_allocator::allocate(std::size_t size) -> void *
{
- // Uses some sort of alignment orignally:
- // https://github.com/phil-opp/blog_os/blob/7f6576c9dc34e360b81236c54c25c7827fd6a2df/src/memory/heap_allocator.rs#L24
auto alloc_start = next;
auto alloc_end = next + size;