Browse Source

[hxcpp] add compact + memUsage

Hugh Sanderson 13 years ago
parent
commit
554e18974f
1 changed files with 10 additions and 0 deletions
  1. 10 0
      std/cpp/vm/Gc.hx

+ 10 - 0
std/cpp/vm/Gc.hx

@@ -12,6 +12,16 @@ class Gc
       untyped __global__.__hxcpp_collect(major);
       untyped __global__.__hxcpp_collect(major);
    }
    }
 
 
+   static public function compact() : Void
+   {
+      untyped __global__.__hxcpp_gc_compact();
+   }
+
+   static public function memUsage() : Int
+   {
+      return untyped __global__.__hxcpp_gc_used_bytes();
+   }
+
    static public function trace(sought:Class<Dynamic>,printInstances:Bool=true) : Int
    static public function trace(sought:Class<Dynamic>,printInstances:Bool=true) : Int
    {
    {
       return untyped __global__.__hxcpp_gc_trace(sought,printInstances);
       return untyped __global__.__hxcpp_gc_trace(sought,printInstances);