@@ -383,29 +383,33 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no`
383383 @test p. exitcode == 1 && p. termsignal == 0
384384 end
385385
386- # --gcthreads
387- code = " print(Threads.ngcthreads())"
388- cpu_threads = ccall (:jl_effective_threads , Int32, ())
389- @test string (cpu_threads) ==
390- read (` $exename --threads auto -e $code ` , String) ==
391- read (` $exename --threads=auto -e $code ` , String) ==
392- read (` $exename -tauto -e $code ` , String) ==
393- read (` $exename -t auto -e $code ` , String)
394- for nt in (nothing , " 1" )
395- withenv (" JULIA_NUM_GC_THREADS" => nt) do
396- @test read (` $exename --gcthreads=2 -e $code ` , String) == " 2"
397- end
398- withenv (" JULIA_NUM_GC_THREADS" => nt) do
399- @test read (` $exename --gcthreads=2,1 -e $code ` , String) == " 3"
386+ # FIXME : Issue #57103 --gcthreads does not have the same semantics
387+ # for Stock GC and MMTk, so the tests below are specific to the Stock GC
388+ @static if Base. USING_STOCK_GC
389+ # --gcthreads
390+ code = " print(Threads.ngcthreads())"
391+ cpu_threads = ccall (:jl_effective_threads , Int32, ())
392+ @test string (cpu_threads) ==
393+ read (` $exename --threads auto -e $code ` , String) ==
394+ read (` $exename --threads=auto -e $code ` , String) ==
395+ read (` $exename -tauto -e $code ` , String) ==
396+ read (` $exename -t auto -e $code ` , String)
397+ for nt in (nothing , " 1" )
398+ withenv (" JULIA_NUM_GC_THREADS" => nt) do
399+ @test read (` $exename --gcthreads=2 -e $code ` , String) == " 2"
400+ end
401+ withenv (" JULIA_NUM_GC_THREADS" => nt) do
402+ @test read (` $exename --gcthreads=2,1 -e $code ` , String) == " 3"
403+ end
400404 end
401- end
402405
403- withenv (" JULIA_NUM_GC_THREADS" => 2 ) do
404- @test read (` $exename -e $code ` , String) == " 2"
405- end
406+ withenv (" JULIA_NUM_GC_THREADS" => 2 ) do
407+ @test read (` $exename -e $code ` , String) == " 2"
408+ end
406409
407- withenv (" JULIA_NUM_GC_THREADS" => " 2,1" ) do
408- @test read (` $exename -e $code ` , String) == " 3"
410+ withenv (" JULIA_NUM_GC_THREADS" => " 2,1" ) do
411+ @test read (` $exename -e $code ` , String) == " 3"
412+ end
409413 end
410414
411415 # --machine-file
@@ -1182,6 +1186,10 @@ end
11821186 end
11831187end
11841188
1189+ # FIXME : Issue #57103: MMTK currently does not use --heap-size-hint since it only
1190+ # supports setting up a hard limit unlike the Stock GC
1191+ # which takes it as a soft limit. For now, we skip the tests below for MMTk
1192+ @static if Base. USING_STOCK_GC
11851193@testset " heap size hint" begin
11861194 # heap-size-hint, we reserve 250 MB for non GC memory (llvm, etc.)
11871195 @test readchomp (` $(Base. julia_cmd ()) --startup-file=no --heap-size-hint=500M -e "println(@ccall jl_gc_get_max_memory()::UInt64)"` ) == " $((500 - 250 )* 1024 * 1024 ) "
@@ -1201,6 +1209,7 @@ end
12011209
12021210 @test readchomp (` $(Base. julia_cmd ()) --startup-file=no --heap-size-hint=10M -e "println(@ccall jl_gc_get_max_memory()::UInt64)"` ) == " $(1 * 1024 * 1024 ) "
12031211end
1212+ end
12041213
12051214# # `Main.main` entrypoint
12061215
0 commit comments