Gc.hx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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();
  11. }
  12. static public function trace(sought:Class<Dynamic>,printInstances:Bool=true) : Int
  13. {
  14. return untyped __global__.__hxcpp_gc_trace(sought,printInstances);
  15. }
  16. #if gc_extra
  17. // Can't add these until the next hxcpp release....
  18. static public function doNotKill(inObject:Dynamic) : Void
  19. {
  20. untyped __global__.__hxcpp_gc_do_not_kill(inObject);
  21. }
  22. static public function getNextZombie() : Dynamic
  23. {
  24. return untyped __global__.__hxcpp_get_next_zombie();
  25. }
  26. static public function safePoint() : Void
  27. {
  28. untyped __global__.__hxcpp_gc_safe_point();
  29. }
  30. static public function enterGCFreeZone() : Void
  31. {
  32. untyped __global__.__hxcpp_enter_gc_free_zone();
  33. }
  34. static public function exitGCFreeZone() : Void
  35. {
  36. untyped __global__.__hxcpp_exit_gc_free_zone();
  37. }
  38. #end
  39. }