Luna/libluna/include/luna/Heap.h

31 lines
784 B
C
Raw Normal View History

#pragma once
#include <luna/Result.h>
namespace std
{
struct nothrow_t
{
explicit nothrow_t() = default;
};
extern const nothrow_t nothrow;
enum class align_val_t : usize
{
};
};
void* operator new(usize size, const std::nothrow_t&) noexcept;
void* operator new[](usize size, const std::nothrow_t&) noexcept;
void operator delete(void* ptr, usize size, std::align_val_t alignment) noexcept;
extern Result<void*> allocate_pages_impl(usize count);
extern Result<void> release_pages_impl(void* address, usize count);
Result<void*> malloc_impl(usize size, bool should_scrub = true);
Result<void*> calloc_impl(usize nmemb, usize size);
Result<void*> realloc_impl(void* ptr, usize size);
Result<void> free_impl(void* ptr);
void dump_heap_usage();