summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2019-04-15 19:49:30 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-05-11 15:34:33 +0200
commit140a96b3a0fa652b66c701ac941cebc17ff24622 (patch)
treeec64deb3e7ef5032dc18991cf5bb0d4eede52fb5 /src/saveload
parentc9fe6e7b8fde3a23f6aab3b55fd8cca639d49696 (diff)
downloadopenttd-140a96b3a0fa652b66c701ac941cebc17ff24622.tar.xz
Change: Limit memory allocations for each Squirrel instance
This can avoid out-of-memory situations due to single scripts using up the entire address space. Instead, scripts that go above the maximum are killed. The maximum is default 1 GB per script, but can be configured by a setting.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/saveload.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index 7ac602a54..fd8b3695f 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -300,6 +300,8 @@ enum SaveLoadVersion : uint16 {
SLV_TREES_WATER_CLASS, ///< 213 PR#7405 WaterClass update for tree tiles.
SLV_ROAD_TYPES, ///< 214 PR#6811 NewGRF road types.
+ SLV_SCRIPT_MEMLIMIT, ///< 215 PR#7516 Limit on AI/GS memory consumption.
+
SL_MAX_VERSION, ///< Highest possible saveload version
};