Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
24
Src/Wasabi/api/wndmgr/gc.cpp
Normal file
24
Src/Wasabi/api/wndmgr/gc.cpp
Normal file
|
@ -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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue