Use platform TLS keys for entity small IDs

This commit is contained in:
notmatthewbeshay
2026-03-11 15:38:53 +11:00
parent 4e8d1c9e17
commit a08cb8d190
4 changed files with 110 additions and 30 deletions
+7
View File
@@ -3,6 +3,9 @@
#include "../Util/Vec3.h"
#include "../Util/Definitions.h"
#include "../Util/SoundTypes.h"
#if !defined(_WIN32)
#include <pthread.h>
#endif
class GrassTile;
@@ -55,7 +58,11 @@ protected:
int tileId;
ThreadStorage();
};
#if defined(_WIN32)
static DWORD tlsIdxShape;
#else
static pthread_key_t tlsIdxShape;
#endif
public:
// Each new thread that needs to use Vec3 pools will need to call one of the following 2 functions, to either create its own
// local storage, or share the default storage already allocated by the main thread