aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/wndmgr/gc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Wasabi/api/wndmgr/gc.cpp')
-rw-r--r--Src/Wasabi/api/wndmgr/gc.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Src/Wasabi/api/wndmgr/gc.cpp b/Src/Wasabi/api/wndmgr/gc.cpp
new file mode 100644
index 00000000..c312b9ea
--- /dev/null
+++ b/Src/Wasabi/api/wndmgr/gc.cpp
@@ -0,0 +1,24 @@
+#include <precomp.h>
+#include "gc.h"
+
+GarbageCollector *garbageCollector=NULL;
+
+GarbageCollector::GarbageCollector() {
+ last = 0;
+ WASABI_API_SYSCB->syscb_registerCallback(this);
+}
+
+GarbageCollector::~GarbageCollector() {
+ WASABI_API_SYSCB->syscb_deregisterCallback(this);
+}
+
+int GarbageCollector::gccb_onGarbageCollect() {
+ uint32_t tc = Wasabi::Std::getTickCount();
+ if (tc < last + 10000) return 0;
+
+ last = tc;
+#ifdef WIN32
+ //SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
+#endif
+ return 0;
+}