Mark Sibly 8 gadi atpakaļ
vecāks
revīzija
ee90390d9a

+ 2 - 2
src/mx2cc/mx2cc.monkey2

@@ -39,8 +39,8 @@ Const TestArgs:="mx2cc makeapp -target=desktop -apptype=console -run src/mx2cc/t
 
 Function Main()
 	
-	'Set aside 256M for GC!
-	GCSetTrigger( 256*1024*1024 )
+	'Set aside 64M for GC!
+	GCSetTrigger( 64*1024*1024 )
 
 	Print ""
 	Print "Mx2cc version "+MX2CC_VERSION

+ 3 - 33
src/mx2cc/test.monkey2

@@ -1,39 +1,9 @@
 
-Namespace test
-
-Global n:Int
-
-Class T
-End
-
-Function F()
-	Print "OOPS"
-End
-
-Class C
-	
-	Field c:T=New T
-	field v:=New Int[10]
-	Field f:Void()=F
-	
-	Method Finalize() Override
-		Global n:=0
-		n+=1
-		Assert( Not c And Not v )
-		Print "Finalizing:"+n
-		f()
-	End
-
-End
-
 Function Main()
 	
-	Print "Hello World!"
+	Print ULong( ".1" )
 	
-	GCSetTrigger( 65536 )
+	Local x:Int=.1
+	Print x
 	
-	For Local i:=0 Until 10000
-		Local c:=New C
-	Next
-
 End

+ 20 - 4
src/mx2cc/tests/finalizer.monkey2

@@ -16,10 +16,9 @@ Class C
 	Field f:Void()=F
 	
 	Method Finalize() Override
-		Global n:=0
 		n+=1
 		Assert( Not c And Not v )
-		Print "Finalizing:"+n
+'		Print "Finalizing:"+n
 		f()
 	End
 
@@ -31,8 +30,25 @@ Function Main()
 	
 	GCSetTrigger( 65536 )
 	
-	For Local i:=0 Until 10000
-		Local c:=New C
+	For Local i:=0 Until 100000
+		
+		For Local j:=0 Until 1000
+		
+			Local c:=New C
+		Next
+		
+		Print "One"
+		
+		GCCollect()
+		
+		Print n
+		
+		Print "Two"
+		
+		GCCollect()
+		
+		Print n
+		
 	Next
 
 End

+ 0 - 3
src/mx2cc/translator_cpp.monkey2

@@ -331,9 +331,6 @@ Class Translator_CPP Extends Translator
 			Emit( "}mx2_"+fdecl.ident+"_roots;" )
 		Endif
 		
-'		EmitBr()
-'		Emit( "bbInit mx2_"+fdecl.ident+"_init(~q"+fdecl.ident+"~q,&mx2_"+fdecl.ident+"_init_f);" )
-	
 	End
 	
 	Method EmitClassProto( ctype:ClassType,fdecl:FileDecl,emitted:StringMap<Bool> )