From a057552afcfeb69974e402b45073a944abb5a3cd Mon Sep 17 00:00:00 2001 From: momo5502 Date: Tue, 28 Feb 2017 13:36:38 +0100 Subject: [PATCH] [Stats] Use stack buffer instead of heap memory --- src/Components/Modules/Stats.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Components/Modules/Stats.cpp b/src/Components/Modules/Stats.cpp index 0eeb98cd..80c8042d 100644 --- a/src/Components/Modules/Stats.cpp +++ b/src/Components/Modules/Stats.cpp @@ -19,13 +19,12 @@ namespace Components // alloc Game::msg_t msg; + char buffer[2048]; ZeroMemory(&msg, sizeof(msg)); - - Utils::Memory::Allocator allocator; - char* buffer = allocator.allocateArray(2048); + ZeroMemory(&buffer, sizeof(buffer)); // init - Game::MSG_Init(&msg, buffer, 2048); + Game::MSG_Init(&msg, buffer, sizeof(buffer)); Game::MSG_WriteString(&msg, "stats"); // get stat buffer