summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/clua.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2010-06-13 00:40:21 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2010-06-13 00:58:31 +0530
commitbc98f6a58c42609979603595cda4a43be940ddc7 (patch)
treea9ae93da8f3a0de8f86dcd966f1570727d93df54 /crawl-ref/source/clua.cc
parentc004b3905373c572b2d86d94e3b421b89a6dda81 (diff)
downloadcrawl-ref-bc98f6a58c42609979603595cda4a43be940ddc7.tar.gz
crawl-ref-bc98f6a58c42609979603595cda4a43be940ddc7.zip
Free memory used for Lua chunks after compiling .des files. This considerably reduces heap use in the first Crawl process to run in a fresh install.
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r--crawl-ref/source/clua.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index 6ace4334b1..6bab5a9d0b 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -111,6 +111,11 @@ void CLua::getregistry(const char *name)
_getregistry(state(), name);
}
+void CLua::gc()
+{
+ lua_gc(state(), LUA_GCCOLLECT, 0);
+}
+
void CLua::save(const char *file)
{
if (!_state)