1
0

gc.cpp 514 B

123456789101112131415161718192021222324
  1. #include <precomp.h>
  2. #include "gc.h"
  3. GarbageCollector *garbageCollector=NULL;
  4. GarbageCollector::GarbageCollector() {
  5. last = 0;
  6. WASABI_API_SYSCB->syscb_registerCallback(this);
  7. }
  8. GarbageCollector::~GarbageCollector() {
  9. WASABI_API_SYSCB->syscb_deregisterCallback(this);
  10. }
  11. int GarbageCollector::gccb_onGarbageCollect() {
  12. uint32_t tc = Wasabi::Std::getTickCount();
  13. if (tc < last + 10000) return 0;
  14. last = tc;
  15. #ifdef WIN32
  16. //SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
  17. #endif
  18. return 0;
  19. }