Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
GC.malloc_allocations
GC.malloc_allocations → Integer
gc/default/default.c
View on GitHub ↗
static VALUE
gc_malloc_allocations(VALUE self)
{
rb_objspace_t *objspace = (rb_objspace_t *)rb_gc_get_objspace();
return ULL2NUM(objspace->malloc_params.allocations);
}
Returns the number of malloc() allocations.
Only available if ruby was built with CALC_EXACT_MALLOC_SIZE.
See also
.malloc_allocated_size
.measure_total_time
.latest_gc_info
.measure_total_time=
also in
3.3 · 3.2 · 3.1 · 3.0