diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-04-15 19:49:30 +0200 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-05-11 15:34:33 +0200 |
commit | 140a96b3a0fa652b66c701ac941cebc17ff24622 (patch) | |
tree | ec64deb3e7ef5032dc18991cf5bb0d4eede52fb5 /src/settings_type.h | |
parent | c9fe6e7b8fde3a23f6aab3b55fd8cca639d49696 (diff) | |
download | openttd-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/settings_type.h')
-rw-r--r-- | src/settings_type.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/settings_type.h b/src/settings_type.h index f2fbd283c..9315cdd96 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -339,6 +339,7 @@ struct AISettings { struct ScriptSettings { uint8 settings_profile; ///< difficulty profile to set initial settings of scripts, esp. random AIs uint32 script_max_opcode_till_suspend; ///< max opcode calls till scripts will suspend + uint32 script_max_memory_megabytes; ///< limit on memory a single script instance may have allocated }; /** Settings related to the new pathfinder. */ |