mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 17:45:33 +00:00
Limit pointers cache size to avoid possible bad_alloc errors
This commit is contained in:
parent
af8bc7d120
commit
5de72c94ab
2 changed files with 2 additions and 2 deletions
|
@ -134,7 +134,7 @@ MWWorld::Cells::Cells (const MWWorld::ESMStore& store, std::vector<ESM::ESMReade
|
||||||
: mStore (store), mReader (reader),
|
: mStore (store), mReader (reader),
|
||||||
mIdCacheIndex (0)
|
mIdCacheIndex (0)
|
||||||
{
|
{
|
||||||
int cacheSize = std::max(Settings::Manager::getInt("pointers cache size", "Cells"), 0);
|
int cacheSize = std::clamp(Settings::Manager::getInt("pointers cache size", "Cells"), 40, 1000);
|
||||||
mIdCache = IdCache(cacheSize, std::pair<std::string, CellStore *> ("", (CellStore*)nullptr));
|
mIdCache = IdCache(cacheSize, std::pair<std::string, CellStore *> ("", (CellStore*)nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ pointers cache size
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
:Type: integer
|
:Type: integer
|
||||||
:Range: >0
|
:Range: 40 to 1000
|
||||||
:Default: 40
|
:Default: 40
|
||||||
|
|
||||||
The count of object pointers that will be saved for a faster search by object ID.
|
The count of object pointers that will be saved for a faster search by object ID.
|
||||||
|
|
Loading…
Reference in a new issue