5 #include "../../config/exports.h" 6 #include "../../DCS_Utils/include/DCS_ModuleUtils.h" 109 char* data_start =
nullptr;
110 char* data =
nullptr;
136 template<
typename T,
typename... Args>
139 buffer.usedSize +=
sizeof(T);
141 if (buffer.usedSize > buffer.size)
143 buffer.usedSize -=
sizeof(T);
144 LOG_CRITICAL(
"Allocating %u bytes would result in buffer overrun. [Available: %u]",
sizeof(T), buffer.size - buffer.usedSize);
149 rb =
new(buffer.data) T(args...);
153 LOG_CRITICAL(
"Failed to allocated %u bytes in allocator.",
sizeof(T));
157 buffer.data +=
sizeof(T);
168 buffer.usedSize +=
sizeof(T);
170 if (buffer.usedSize > buffer.size)
172 buffer.usedSize -=
sizeof(T);
173 LOG_CRITICAL(
"Allocating %u bytes would result in buffer overrun. [Available: %u]",
sizeof(T), buffer.size - buffer.usedSize);
178 rb =
new(buffer.data) T();
182 LOG_CRITICAL(
"Failed to allocated %u bytes in allocator.",
sizeof(T));
186 buffer.data +=
sizeof(T);
232 u64* maximizers =
nullptr;
233 f64* maxima =
nullptr;
237 if(maximizers !=
nullptr)
242 if(maxima !=
nullptr)
#define DCS_API
Defines the export interface acessible via the dll-interface. Only important for SHARED LIB Compile M...
Definition: exports.h:116
Definition: DCS_ModuleCore.h:229
Linearly allocates memory for a single use.
Definition: DCS_ModuleCore.h:121
Definition: DCS_ModuleCore.h:107
double f64
Equivalent to double.
Definition: DCS_ModuleUtils.h:61
const DCS_API u16 GetMaxHardwareConcurrency()
Get current machine maximum hardware concurrency (Number of physical threads supported by the current...
Definition: threading.cpp:6
T * allocate()
Allocates a new section of the pool for a new type T.
Definition: DCS_ModuleCore.h:166
unsigned short u16
Equivalent to uint_16t.
Definition: DCS_ModuleUtils.h:56
T * allocate(Args...args)
Allocates a new section of the pool for a new type T.
Definition: DCS_ModuleCore.h:137
#define DCS_REGISTER_CALL(...)
Append this definition before function declarations to register it as a tcp connection callable...
Definition: exports.h:74
Definition: registry.h:70
#define LOG_CRITICAL(msg,...)
Alias to LOG_LVL(Critical, msg, VA_ARGS)
Definition: DCS_ModuleUtils.h:38
unsigned long long u64
Equivalent to uint_64t.
Definition: DCS_ModuleUtils.h:52
unsigned char u8
Equivalent to uint_8t.
Definition: DCS_ModuleUtils.h:58