1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Nullkiller: reduce memory usage for x86

This commit is contained in:
Andrii Danylchenko 2021-05-16 15:10:59 +03:00 committed by Andrii Danylchenko
parent 7184364bcb
commit 87a8c776c9
2 changed files with 24 additions and 2 deletions

View File

@ -9,6 +9,24 @@
*/
#pragma once
// Check windows
#if _WIN32 || _WIN64
#if _WIN64
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif
// Check GCC
#if __GNUC__
#if __x86_64__ || __ppc64__
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif
/*********************** TBB.h ********************/
#include "tbb/atomic.h"

View File

@ -23,14 +23,18 @@ std::shared_ptr<boost::multi_array<AIPathNode, 5>> AISharedStorage::shared;
std::set<int3> commitedTiles;
std::set<int3> commitedTilesInitial;
const uint64_t FirstActorMask = 1;
#ifdef ENVIRONMENT64
const int BUCKET_COUNT = 11;
#else
const int BUCKET_COUNT = 7;
#endif // ENVIRONMENT64
const uint64_t FirstActorMask = 1;
const int BUCKET_SIZE = GameConstants::MAX_HEROES_PER_PLAYER;
const int NUM_CHAINS = BUCKET_COUNT * BUCKET_SIZE;
const uint64_t MIN_ARMY_STRENGTH_FOR_CHAIN = 5000;
const uint64_t MIN_ARMY_STRENGTH_FOR_NEXT_ACTOR = 1000;
AISharedStorage::AISharedStorage(int3 sizes)
{
if(!shared){