Archived
1
0
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
winamp/Src/Wasabi/api/wndmgr/gc.cpp

25 lines
514 B
C++
Raw Normal View History

2024-09-24 12:54:57 +00:00
#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;
}