2020-05-30 15:55:23 +02:00
|
|
|
#pragma once
|
2020-07-05 22:19:06 +02:00
|
|
|
#include "qmalloc.h"
|
2020-05-30 15:55:23 +02:00
|
|
|
|
|
|
|
extern char* malloc_buffer;
|
|
|
|
extern int malloc_size;
|
|
|
|
extern char* malloc_ptr;
|
|
|
|
extern int malloc_free;
|
|
|
|
extern int malloc_used;
|
2020-07-05 22:19:06 +02:00
|
|
|
extern T5M::Memory::MemoryPool* gameMemory;
|
|
|
|
template <typename T>
|
2020-07-06 18:56:18 +02:00
|
|
|
[[nodiscard]] T* game_malloc(size_t count= 1) noexcept {
|
2020-07-05 22:19:06 +02:00
|
|
|
return gameMemory->malloc<T>(count);
|
|
|
|
}
|
2020-07-06 18:56:18 +02:00
|
|
|
void init_game_malloc() noexcept;
|
|
|
|
void game_free(void* ptr) noexcept;
|