Iros
 
Loading...
Searching...
No Matches
custom.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef DI_CUSTOM_PLATFORM
4#include DI_CUSTOM_PLATFORM
5#elifdef DI_NO_USE_STD
9
10namespace di::platform {
11using ThreadId = int;
12
13inline auto get_current_thread_id() -> ThreadId {
14 return 0;
15}
16
17using DefaultLock = di::sync::DumbSpinlock;
18using DefaultAllocator = container::InfallibleAllocator;
19using DefaultFallibleAllocator = container::FallibleAllocator;
20}
21#else
22#include <mutex>
23#include <thread>
24
29
30namespace di::platform {
31using ThreadId = std::thread::id;
32
34 return std::this_thread::get_id();
35}
36
37using DefaultLock = std::mutex;
38
41}
42#endif
Definition custom.h:30
container::FallibleAllocator DefaultFallibleAllocator
Definition custom.h:40
std::mutex DefaultLock
Definition custom.h:37
container::InfallibleAllocator DefaultAllocator
Definition custom.h:39
auto get_current_thread_id() -> ThreadId
Definition custom.h:33
std::thread::id ThreadId
Definition custom.h:31
Definition fallible_allocator.h:13
Definition infallible_allocator.h:10