fix: use vector over array to reduce executable size by 1MiB

This commit is contained in:
鲁树人 2024-10-18 08:51:04 +09:00
parent 665dc3de92
commit 3946440654

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <windows.h> #include <windows.h>
#include <array>
#include <filesystem> #include <filesystem>
#include <fstream> #include <fstream>
#include <mutex> #include <mutex>
@ -79,7 +80,7 @@ class KggTask {
} }
size_t offset{0}; size_t offset{0};
thread_local std::array<uint8_t, 1024 * 1024> temp_buffer{}; thread_local std::vector<uint8_t> temp_buffer(1024 * 1024, 0);
auto buf_signed = std::span(reinterpret_cast<char*>(temp_buffer.data()), temp_buffer.size()); auto buf_signed = std::span(reinterpret_cast<char*>(temp_buffer.data()), temp_buffer.size());
auto buf_unsigned = std::span(temp_buffer); auto buf_unsigned = std::span(temp_buffer);