aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/IntCache.h
blob: edc9764d3d053c460de28ea087ad395f471de44f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include "ArrayWithLength.h"


class IntCache
{
private:

	class ThreadStorage
	{
	public:
		int maxSize;

		vector<intArray> tcache;
		vector<intArray> tallocated;
		
		vector<intArray> cache;
		vector<intArray> allocated;
		vector<intArray> toosmall;	// 4J added
		~ThreadStorage();
	};
	static DWORD tlsIdx;

	static const int TINY_CUTOFF = 256;

public:
	static intArray allocate(int size);
	static void releaseAll();

	static void CreateNewThreadStorage();
	static void ReleaseThreadStorage();
	static void Reset();		// 4J added
};