@@ -8,6 +8,11 @@ let iobuf = IOBuffer()
88 end
99end
1010
11+ # Issue #57103: This test does not work with MMTk because of fastpath
12+ # allocation which never calls the allocation profiler.
13+ # TODO : We should port these observability tools (e.g. allocation
14+ # profiler and heap snapshot) to MMTk
15+ @static if Base. USING_STOCK_GC
1116@testset " alloc profiler doesn't segfault" begin
1217 res = Allocs. @profile sample_rate= 1.0 begin
1318 # test the allocations during compilation
7378 @test length (first_alloc. stacktrace) > 0
7479 @test length (string (first_alloc. type)) > 0
7580
76- # Issue #57103: This test does not work with MMTk because of fastpath
77- # allocation which never calls the allocation profiler.
78- # TODO : We should port these observability tools (e.g. allocation
79- # profiler and heap snapshot) to MMTk
80- @static if Base. USING_STOCK_GC
81- @testset for type in (Task, Vector{Float64},)
82- @test length (filter (a-> a. type <: type , profile. allocs)) >= NUM_TASKS
83- end
81+ @testset for type in (Task, Vector{Float64},)
82+ @test length (filter (a-> a. type <: type , profile. allocs)) >= NUM_TASKS
8483 end
8584
8685 # TODO : it would be nice to assert that these tasks
149148 @test length ([a for a in prof. allocs if a. type == String]) >= 1
150149end
151150
152- # FIXME : Issue #57103 disabling test for MMTk.
153- @static if Base. USING_STOCK_GC
154151@testset " alloc profiler catches allocs from codegen" begin
155152 @eval begin
156153 struct MyType x:: Int ; y:: Int end
170167 @test length (prof. allocs) >= 1
171168 @test length ([a for a in prof. allocs if a. type == MyType]) >= 1
172169end
173- end
174170
175171@testset " alloc profiler catches allocs from buffer resize" begin
176172 f (a) = for _ in 1 : 100 ; push! (a, 1 ); end
187183 @test length ([a for a in prof. allocs if a. type === Allocs. BufferType]) == 1
188184 @test length ([a for a in prof. allocs if a. type === Memory{Int}]) >= 2
189185end
186+ end
0 commit comments