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.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "script_types.hpp"
|
||||
#include "../script_suspend.hpp"
|
||||
#include "../squirrel.hpp"
|
||||
|
||||
/**
|
||||
* The callback function for Mode-classes.
|
||||
@@ -48,6 +49,7 @@ protected:
|
||||
~ActiveInstance();
|
||||
private:
|
||||
ScriptInstance *last_active; ///< The active instance before we go instantiated.
|
||||
ScriptAllocatorScope alc_scope; ///< Keep the correct allocator for the script instance activated
|
||||
|
||||
static ScriptInstance *active; ///< The global current active instance.
|
||||
};
|
||||
|
Reference in New Issue
Block a user