F4MP/tiltedcode/Code/immersive_launcher/loader/TlsMemory.cpp
Jous99 37b16f1547 code upload
codigo original de f4mp y tilted para referencias
2026-01-06 18:45:00 +01:00

26 lines
617 B
C++

/*
* This file is part of the CitizenFX project - http://citizen.re/
*
* See LICENSE and MENTIONS in the root of the source tree for information
* regarding licensing.
*/
#include <cstdint>
// Changes:
// - 2021/2/23: use TLS touched class to automatically initialize TLS.
// - 2021/2/24: Lowered necessary TLS pool size for Fallout4 and SkyrimSE.
#define DECLARE_TLS_VARS(i) __declspec(thread) uint8_t tls[sizeof(int) * i]
DECLARE_TLS_VARS(7096);
#include <Windows.h>
struct TlsToucher
{
TlsToucher() { *reinterpret_cast<int*>(&tls[4]) = static_cast<int>(GetTickCount64()); }
};
TlsToucher toucher;