summaryrefslogtreecommitdiff
path: root/Kernel/Heap/kmalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Heap/kmalloc.h')
-rw-r--r--Kernel/Heap/kmalloc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Kernel/Heap/kmalloc.h b/Kernel/Heap/kmalloc.h
index 7acc5f018a..5c0101ea32 100644
--- a/Kernel/Heap/kmalloc.h
+++ b/Kernel/Heap/kmalloc.h
@@ -32,6 +32,13 @@
#define KMALLOC_SCRUB_BYTE 0xbb
#define KFREE_SCRUB_BYTE 0xaa
+#define MAKE_ALIGNED_ALLOCATED(type, alignment) \
+public: \
+ void* operator new(size_t) { return kmalloc_aligned<alignment>(sizeof(type)); } \
+ void operator delete(void* ptr) { kfree_aligned(ptr); } \
+ \
+private:
+
void kmalloc_init();
[[gnu::malloc, gnu::returns_nonnull, gnu::alloc_size(1)]] void* kmalloc_impl(size_t);
[[gnu::malloc, gnu::returns_nonnull, gnu::alloc_size(1)]] void* kmalloc_eternal(size_t);