Ver código fonte

Add function for tracing live GC references to class instances

Hugh Sanderson 15 anos atrás
pai
commit
fc1f060ad8
2 arquivos alterados com 6 adições e 1 exclusões
  1. 1 1
      gencpp.ml
  2. 5 0
      std/cpp/vm/Gc.hx

+ 1 - 1
gencpp.ml

@@ -2398,7 +2398,7 @@ let generate_class_files common_ctx member_types super_deps constructor_deps cla
 
 		(* MARK function - only used with internal GC *)
 		output_cpp ("void " ^ class_name ^ "::__Mark(HX_MARK_PARAMS)\n{\n");
-		output_cpp ("	HX_MARK_BEGIN_CLASS(" ^ class_name ^ ");\n");
+		output_cpp ("	HX_MARK_BEGIN_CLASS(" ^ smart_class_name ^ ");\n");
 		if (implement_dynamic) then
 			output_cpp "	HX_MARK_DYNAMIC;\n";
 		List.iter

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

@@ -12,4 +12,9 @@ class Gc
       untyped __global__.__hxcpp_collect();
    }
 
+   static public function trace(sought:Class<Dynamic>) : Void
+   {
+      untyped __global__.__hxcpp_gc_trace(sought);
+   }
+
 }