|
@@ -28,20 +28,6 @@ class Gc
|
|
|
public static inline var MEM_INFO_CURRENT = 2;
|
|
|
public static inline var MEM_INFO_LARGE = 3;
|
|
|
|
|
|
- static public function enable(inEnable:Bool) : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_enable(inEnable);
|
|
|
- }
|
|
|
-
|
|
|
- static public function run(major:Bool) : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_collect(major);
|
|
|
- }
|
|
|
-
|
|
|
- static public function compact() : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_gc_compact();
|
|
|
- }
|
|
|
|
|
|
// Introduced hxcpp_api_level 310
|
|
|
// Returns stats on memory usage:
|
|
@@ -61,63 +47,52 @@ class Gc
|
|
|
return NativeGc.memInfo(inWhatInfo);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
static public function memUsage() : Int
|
|
|
{
|
|
|
return Std.int(NativeGc.memInfo(MEM_INFO_USAGE));
|
|
|
}
|
|
|
|
|
|
- static public function trace(sought:Class<Dynamic>,printInstances:Bool=true) : Int
|
|
|
- {
|
|
|
- return untyped __global__.__hxcpp_gc_trace(sought,printInstances);
|
|
|
- }
|
|
|
-
|
|
|
static public function versionCheck() { return true; }
|
|
|
|
|
|
- static public function doNotKill(inObject:Dynamic) : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_gc_do_not_kill(inObject);
|
|
|
- }
|
|
|
|
|
|
- static public function getNextZombie() : Dynamic
|
|
|
- {
|
|
|
- return untyped __global__.__hxcpp_get_next_zombie();
|
|
|
- }
|
|
|
|
|
|
- static public function safePoint() : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_gc_safe_point();
|
|
|
- }
|
|
|
+ @:native("__hxcpp_enable")
|
|
|
+ static public function enable(inEnable:Bool) : Void { }
|
|
|
|
|
|
- static public function enterGCFreeZone() : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_enter_gc_free_zone();
|
|
|
- }
|
|
|
+ @:native("__hxcpp_collect")
|
|
|
+ static public function run(major:Bool) : Void { }
|
|
|
|
|
|
- static public function exitGCFreeZone() : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_exit_gc_free_zone();
|
|
|
- }
|
|
|
+ @:native("__hxcpp_gc_compact")
|
|
|
+ static public function compact() : Void { }
|
|
|
|
|
|
- static public function setMinimumFreeSpace(inBytes:Int) : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_set_minimum_free_space(inBytes);
|
|
|
- }
|
|
|
+ @:native("__hxcpp_gc_trace")
|
|
|
+ static public function trace(sought:Class<Dynamic>,printInstances:Bool=true) : Int return 0;
|
|
|
|
|
|
- static public function setTargetFreeSpacePercentage(inPercentage:Int) : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_set_target_free_space_percentage(inPercentage);
|
|
|
- }
|
|
|
+ @:native("__hxcpp_gc_do_not_kill")
|
|
|
+ static public function doNotKill(inObject:Dynamic) : Void { }
|
|
|
|
|
|
- static public function setMinimumWorkingMemory(inBytes:Int) : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_set_minimum_working_memory(inBytes);
|
|
|
- }
|
|
|
+ @:native("__hxcpp_get_next_zombie")
|
|
|
+ static public function getNextZombie() : Dynamic return null;
|
|
|
|
|
|
- @:unreflective
|
|
|
- inline static public function setFinalizer<T>(inObject:T, inFinalizer:cpp.Callable<T->Void> ) : Void
|
|
|
- {
|
|
|
- untyped __global__.__hxcpp_set_finalizer(inObject, inFinalizer);
|
|
|
- }
|
|
|
+ @:native("__hxcpp_gc_safe_point")
|
|
|
+ static public function safePoint() : Void { }
|
|
|
+
|
|
|
+ @:native("__hxcpp_enter_gc_free_zone")
|
|
|
+ static public function enterGCFreeZone() : Void { }
|
|
|
+
|
|
|
+ @:native("__hxcpp_exit_gc_free_zone")
|
|
|
+ static public function exitGCFreeZone() : Void { }
|
|
|
+
|
|
|
+ @:native("__hxcpp_set_minimum_free_space")
|
|
|
+ static public function setMinimumFreeSpace(inBytes:Int) : Void { }
|
|
|
+
|
|
|
+ @:native("__hxcpp_set_target_free_space_percentage")
|
|
|
+ static public function setTargetFreeSpacePercentage(inPercentage:Int) : Void { }
|
|
|
+
|
|
|
+ @:native("__hxcpp_set_minimum_working_memory")
|
|
|
+ static public function setMinimumWorkingMemory(inBytes:Int) : Void { }
|
|
|
+
|
|
|
+ @:native("__hxcpp_set_finalizer")
|
|
|
+ static public function setFinalizer<T>(inObject:T, inFinalizer:cpp.Callable<T->Void> ) : Void { }
|
|
|
}
|
|
|
|