@@ -232,6 +232,7 @@ def test_stat_heap
232232
233233 assert_equal ( GC ::INTERNAL_CONSTANTS [ :BASE_SLOT_SIZE ] + GC ::INTERNAL_CONSTANTS [ :RVALUE_OVERHEAD ] ) * ( 2 **i ) , stat_heap [ :slot_size ]
234234 assert_operator stat_heap [ :heap_live_slots ] , :<= , stat [ :heap_live_slots ]
235+ assert_operator stat_heap [ :heap_free_slots ] , :<= , stat [ :heap_free_slots ]
235236 assert_operator stat_heap [ :heap_eden_pages ] , :<= , stat [ :heap_eden_pages ]
236237 assert_operator stat_heap [ :heap_eden_slots ] , :>= , 0
237238 assert_operator stat_heap [ :total_allocated_pages ] , :>= , 0
@@ -262,7 +263,7 @@ def test_stat_heap_all
262263 GC . stat_heap ( i , stat_heap )
263264
264265 # Remove keys that can vary between invocations
265- %i( total_allocated_objects heap_live_slots ) . each do |sym |
266+ %i( total_allocated_objects heap_live_slots heap_free_slots ) . each do |sym |
266267 stat_heap [ sym ] = stat_heap_all [ i ] [ sym ] = 0
267268 end
268269
@@ -288,6 +289,7 @@ def test_stat_heap_constraints
288289 end
289290
290291 assert_equal stat [ :heap_live_slots ] , stat_heap_sum [ :heap_live_slots ]
292+ assert_equal stat [ :heap_free_slots ] , stat_heap_sum [ :heap_free_slots ]
291293 assert_equal stat [ :heap_eden_pages ] , stat_heap_sum [ :heap_eden_pages ]
292294 assert_equal stat [ :heap_available_slots ] , stat_heap_sum [ :heap_eden_slots ]
293295 assert_equal stat [ :total_allocated_objects ] , stat_heap_sum [ :total_allocated_objects ]
0 commit comments