[Stats] Use stack buffer instead of heap memory
This commit is contained in:
parent
1267a4a9f3
commit
a057552afc
@ -19,13 +19,12 @@ namespace Components
|
|||||||
|
|
||||||
// alloc
|
// alloc
|
||||||
Game::msg_t msg;
|
Game::msg_t msg;
|
||||||
|
char buffer[2048];
|
||||||
ZeroMemory(&msg, sizeof(msg));
|
ZeroMemory(&msg, sizeof(msg));
|
||||||
|
ZeroMemory(&buffer, sizeof(buffer));
|
||||||
Utils::Memory::Allocator allocator;
|
|
||||||
char* buffer = allocator.allocateArray<char>(2048);
|
|
||||||
|
|
||||||
// init
|
// init
|
||||||
Game::MSG_Init(&msg, buffer, 2048);
|
Game::MSG_Init(&msg, buffer, sizeof(buffer));
|
||||||
Game::MSG_WriteString(&msg, "stats");
|
Game::MSG_WriteString(&msg, "stats");
|
||||||
|
|
||||||
// get stat buffer
|
// get stat buffer
|
||||||
|
Loading…
Reference in New Issue
Block a user