summaryrefslogtreecommitdiff
path: root/gc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'gc.rb')
-rw-r--r--gc.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/gc.rb b/gc.rb
index 5afed2535b..8bba0dfbc9 100644
--- a/gc.rb
+++ b/gc.rb
@@ -31,11 +31,11 @@ module GC
# are not guaranteed to be future-compatible, and may be ignored if the
# underlying implementation does not support them.
def self.start full_mark: true, immediate_mark: true, immediate_sweep: true
- __builtin.gc_start_internal full_mark, immediate_mark, immediate_sweep
+ Primitive.gc_start_internal full_mark, immediate_mark, immediate_sweep
end
def garbage_collect full_mark: true, immediate_mark: true, immediate_sweep: true
- __builtin.gc_start_internal full_mark, immediate_mark, immediate_sweep
+ Primitive.gc_start_internal full_mark, immediate_mark, immediate_sweep
end
# call-seq:
@@ -49,7 +49,7 @@ module GC
# GC.enable #=> false
#
def self.enable
- __builtin.gc_enable
+ Primitive.gc_enable
end
# call-seq:
@@ -61,7 +61,7 @@ module GC
# GC.disable #=> false
# GC.disable #=> true
def self.disable
- __builtin.gc_disable
+ Primitive.gc_disable
end
# call-seq:
@@ -69,7 +69,7 @@ module GC
#
# Returns current status of GC stress mode.
def self.stress
- __builtin.gc_stress_get
+ Primitive.gc_stress_get
end
# call-seq:
@@ -87,7 +87,7 @@ module GC
# 0x02:: no immediate sweep
# 0x04:: full mark after malloc/calloc/realloc
def self.stress=(flag)
- __builtin.gc_stress_set_m flag
+ Primitive.gc_stress_set_m flag
end
# call-seq:
@@ -97,7 +97,7 @@ module GC
#
# It returns the number of times GC occurred since the process started.
def self.count
- __builtin.gc_count
+ Primitive.gc_count
end
# call-seq:
@@ -146,7 +146,7 @@ module GC
#
# This method is only expected to work on C Ruby.
def self.stat hash_or_key = nil
- __builtin.gc_stat hash_or_key
+ Primitive.gc_stat hash_or_key
end
# call-seq:
@@ -160,11 +160,11 @@ module GC
# it is overwritten and returned.
# This is intended to avoid probe effect.
def self.latest_gc_info hash_or_key = nil
- __builtin.gc_latest_gc_info hash_or_key
+ Primitive.gc_latest_gc_info hash_or_key
end
def self.compact
- __builtin.rb_gc_compact
+ Primitive.rb_gc_compact
end
# call-seq:
@@ -182,13 +182,13 @@ module GC
# object, that object should be pushed on the mark stack, and will
# make a SEGV.
def self.verify_compaction_references(toward: nil, double_heap: false)
- __builtin.gc_verify_compaction_references(toward, double_heap)
+ Primitive.gc_verify_compaction_references(toward, double_heap)
end
end
module ObjectSpace
def garbage_collect full_mark: true, immediate_mark: true, immediate_sweep: true
- __builtin.gc_start_internal full_mark, immediate_mark, immediate_sweep
+ Primitive.gc_start_internal full_mark, immediate_mark, immediate_sweep
end
module_function :garbage_collect