Gc.hx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. // Can't add these until the next hxcpp release....
  17. @:functionCode("\n#ifdef HXCPP_GC_FUNCTIONS_1\n")
  18. @:functionTailCode('\n#else\n#error "Please upgrade your version of HXCPP"\n#endif\n')
  19. static public function versionCheck() { return true; }
  20. static public function doNotKill(inObject:Dynamic) : Void
  21. {
  22. untyped __global__.__hxcpp_gc_do_not_kill(inObject);
  23. }
  24. static public function getNextZombie() : Dynamic
  25. {
  26. return untyped __global__.__hxcpp_get_next_zombie();
  27. }
  28. static public function safePoint() : Void
  29. {
  30. untyped __global__.__hxcpp_gc_safe_point();
  31. }
  32. static public function enterGCFreeZone() : Void
  33. {
  34. untyped __global__.__hxcpp_enter_gc_free_zone();
  35. }
  36. static public function exitGCFreeZone() : Void
  37. {
  38. untyped __global__.__hxcpp_exit_gc_free_zone();
  39. }
  40. }