This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
hilbert-os/euler/source/memory/delete.cpp

17 lines
490 B
C++

#include <euler/heap.hpp>
void operator delete(void *ptr) {
euler::dealloc((uint8_t *)ptr - 8, *(uint64_t *)((uint8_t *)ptr - 8));
}
void operator delete(void *ptr, uint64_t) {
euler::dealloc((uint8_t *)ptr - 8, *(uint64_t *)((uint8_t *)ptr - 8));
}
void operator delete[](void *ptr) {
euler::dealloc((uint8_t *)ptr - 8, *(uint64_t *)((uint8_t *)ptr - 8));
}
void operator delete[](void *ptr, uint64_t) {
euler::dealloc((uint8_t *)ptr - 8, *(uint64_t *)((uint8_t *)ptr - 8));
}