diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-21 11:19:35 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-21 11:19:35 +0000 |
commit | 6e7c6ae56792add3f8d701eca7d144d96ed19458 (patch) | |
tree | 855f8b6bcdd61c92be270aa6df1efbad2f603547 /crawl-ref/source/clua.h | |
parent | efe55b27c4832476e55ba9100da52daa74fdb75b (diff) | |
download | crawl-ref-6e7c6ae56792add3f8d701eca7d144d96ed19458.tar.gz crawl-ref-6e7c6ae56792add3f8d701eca7d144d96ed19458.zip |
Added support for limiting memory used by the Lua interpreter.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1613 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/clua.h')
-rw-r--r-- | crawl-ref/source/clua.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/clua.h b/crawl-ref/source/clua.h index af6196f826..a060923da7 100644 --- a/crawl-ref/source/clua.h +++ b/crawl-ref/source/clua.h @@ -18,6 +18,10 @@ extern "C" { #include "libutil.h" #include "externs.h" +#ifndef CLUA_MAX_MEMORY_USE +#define CLUA_MAX_MEMORY_USE (6 * 1024) +#endif + class CLua; class lua_call_throttle { @@ -76,6 +80,7 @@ public: // If managed_vm is set, we have to take steps to control badly-behaved // scripts. bool managed_vm; + bool shutting_down; int throttle_unit_lines; int throttle_sleep_ms; int throttle_sleep_start, throttle_sleep_end; @@ -85,6 +90,8 @@ public: int max_mixed_call_depth; int max_lua_call_depth; + long memory_used; + static const int MAX_THROTTLE_SLEEPS = 100; private: |