feat(heap): Create new HeapAllocator implementation

This commit is contained in:
Daniel Hammer
2025-03-15 11:29:05 +01:00
parent 2b6c2fa827
commit ff347b1da5
8 changed files with 125 additions and 36 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
#include "Spinlock.hpp"
namespace kcp {
void Spinlock::Aquire() {
void Spinlock::Acquire() {
while (atomic_flag.test_and_set(std::memory_order_acquire));
}
+1 -1
View File
@@ -11,7 +11,7 @@ namespace kcp {
class Spinlock {
std::atomic_flag atomic_flag{ATOMIC_FLAG_INIT};
public:
void Aquire();
void Acquire();
void Release();
};
};
+4 -1
View File
@@ -75,7 +75,10 @@ namespace kcp
size_t pages = 0;
public:
noHeapVector() {
kout << "NoMallocVector: constructor called" << Kt::newline;
// We shouldn't have used KernelOutStream in this constructor, will crash if used in a global object
// due to global constructors
// kout << "NoMallocVector: constructor called" << Kt::newline;
pages = 0;
this->sz = 0;
this->array = nullptr;