Broom 1.0.0
A thread-local C++ Garbage Collector
Loading...
Searching...
No Matches
platform-base.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdlib>
4#include <format>
5#include <print>
6#include <string>
7
8#include "src/allocator.h"
9
10#define ABORT(m, ...) \
11 ::broom::platform::Abort(__FILE__, __LINE__, m __VA_OPT__(, ) __VA_ARGS__)
12
13namespace broom {
14namespace platform {
16
17template <typename... Args>
18BROOM_NORETURN void Abort(const char* file, size_t line,
19 std::format_string<Args...> fmt, Args&&... args) {
20 std::print("{}:{}: ", file, line);
21 std::println(fmt, std::forward<Args>(args)...);
22 abort();
23}
24
27 size_t space_size,
29} // namespace platform
30} // namespace broom
31
static constexpr const MemoryPermissions kDefaultPermissions
Definition allocator.h:247
#define BROOM_NORETURN
Definition macros.h:10
void * GetStackBottom()
void UnmapMemorySpace(const MemorySpace &space)
BROOM_NORETURN void Abort(const char *file, size_t line, std::format_string< Args... > fmt, Args &&... args)
MemorySpace MapMemorySpace(size_t space_size, MemoryPermissions permissions=Allocator::kDefaultPermissions)
MemoryPermissions
Definition allocator.h:111
std::queue< T, broom::deque< T > > queue
Definition broom-queue.h:12