소스 검색

added dumpMemory()

Nicolas Cannasse 9 년 전
부모
커밋
d1b01911cf
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      std/hl/Gc.hx

+ 9 - 0
std/hl/Gc.hx

@@ -30,6 +30,15 @@ class Gc {
 		return { totalAllocated : tot, allocationCount : count, currentMemory : mem };
 	}
 
+	/**
+		Dump whole memory into target filename for analysis.
+	**/
+	public static function dumpMemory( ?fileName : String = "hlmemory.dump" ) {
+		_dump(@:privateAccess fileName.toUtf8());
+	}
+
+	@:hlNative("std", "gc_dump_memory") static function _dump( b : hl.Bytes ) : Void {}
+
 	@:hlNative("std", "gc_profile") public static function activeProfileInfos( b : Bool ) : Void {}
 	@:hlNative("std", "gc_enable") public static function enable( b : Bool ) : Void {}
 	@:hlNative("std", "gc_major") public static function major() : Void {}