Gc.hx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package cpp.vm;
  2. class Gc
  3. {
  4. static public function enable(inEnable:Bool) : Void
  5. {
  6. untyped __global__.__hxcpp_enable(inEnable);
  7. }
  8. static public function run(major:Bool) : Void
  9. {
  10. untyped __global__.__hxcpp_collect(major);
  11. }
  12. static public function compact() : Void
  13. {
  14. untyped __global__.__hxcpp_gc_compact();
  15. }
  16. static public function memUsage() : Int
  17. {
  18. return untyped __global__.__hxcpp_gc_used_bytes();
  19. }
  20. static public function trace(sought:Class<Dynamic>,printInstances:Bool=true) : Int
  21. {
  22. return untyped __global__.__hxcpp_gc_trace(sought,printInstances);
  23. }
  24. static public function versionCheck() { return true; }
  25. static public function doNotKill(inObject:Dynamic) : Void
  26. {
  27. untyped __global__.__hxcpp_gc_do_not_kill(inObject);
  28. }
  29. static public function getNextZombie() : Dynamic
  30. {
  31. return untyped __global__.__hxcpp_get_next_zombie();
  32. }
  33. static public function safePoint() : Void
  34. {
  35. untyped __global__.__hxcpp_gc_safe_point();
  36. }
  37. static public function enterGCFreeZone() : Void
  38. {
  39. untyped __global__.__hxcpp_enter_gc_free_zone();
  40. }
  41. static public function exitGCFreeZone() : Void
  42. {
  43. untyped __global__.__hxcpp_exit_gc_free_zone();
  44. }
  45. }