diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2024-09-17 11:39:43 -0400 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2024-09-17 15:22:43 -0400 |
| commit | 2af080bd3031cc4ea37c985f5782355df151ab1c (patch) | |
| tree | 04bdbf15f3f64382908b74d14a730c21502d7107 | |
| parent | 5de7517bcb735b9d9c0daddaf7f519f63b033a9e (diff) | |
Change rb_gc_impl_get_profile_total_time to return unsigned long long
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11639
| -rw-r--r-- | gc.c | 2 | ||||
| -rw-r--r-- | gc.rb | 2 | ||||
| -rw-r--r-- | gc/default.c | 4 | ||||
| -rw-r--r-- | gc/gc_impl.h | 2 |
4 files changed, 5 insertions, 5 deletions
@@ -636,7 +636,7 @@ typedef struct gc_function_map { // Statistics VALUE (*set_measure_total_time)(void *objspace_ptr, VALUE flag); VALUE (*get_measure_total_time)(void *objspace_ptr); - VALUE (*get_profile_total_time)(void *objspace_ptr); + unsigned long long (*get_profile_total_time)(void *objspace_ptr); size_t (*gc_count)(void *objspace_ptr); VALUE (*latest_gc_info)(void *objspace_ptr, VALUE key); size_t (*stat)(void *objspace_ptr, VALUE hash_or_sym); @@ -352,7 +352,7 @@ module GC # Return measured \GC total time in nano seconds. def self.total_time Primitive.cexpr! %{ - rb_gc_impl_get_profile_total_time(rb_gc_get_objspace()) + ULL2NUM(rb_gc_impl_get_profile_total_time(rb_gc_get_objspace())) } end end diff --git a/gc/default.c b/gc/default.c index d959e108ab..149eae5971 100644 --- a/gc/default.c +++ b/gc/default.c @@ -1522,7 +1522,7 @@ rb_gc_impl_set_event_hook(void *objspace_ptr, const rb_event_flag_t event) objspace->flags.has_newobj_hook = !!(objspace->hook_events & RUBY_INTERNAL_EVENT_NEWOBJ); } -VALUE +unsigned long long rb_gc_impl_get_profile_total_time(void *objspace_ptr) { rb_objspace_t *objspace = objspace_ptr; @@ -1530,7 +1530,7 @@ rb_gc_impl_get_profile_total_time(void *objspace_ptr) unsigned long long marking_time = objspace->profile.marking_time_ns; unsigned long long sweeping_time = objspace->profile.sweeping_time_ns; - return ULL2NUM(marking_time + sweeping_time); + return marking_time + sweeping_time; } VALUE diff --git a/gc/gc_impl.h b/gc/gc_impl.h index 12527845f7..ec47c9fe7e 100644 --- a/gc/gc_impl.h +++ b/gc/gc_impl.h @@ -87,7 +87,7 @@ GC_IMPL_FN VALUE rb_gc_impl_object_id_to_ref(void *objspace_ptr, VALUE object_id // Statistics GC_IMPL_FN VALUE rb_gc_impl_set_measure_total_time(void *objspace_ptr, VALUE flag); GC_IMPL_FN VALUE rb_gc_impl_get_measure_total_time(void *objspace_ptr); -GC_IMPL_FN VALUE rb_gc_impl_get_profile_total_time(void *objspace_ptr); +GC_IMPL_FN unsigned long long rb_gc_impl_get_profile_total_time(void *objspace_ptr); GC_IMPL_FN size_t rb_gc_impl_gc_count(void *objspace_ptr); GC_IMPL_FN VALUE rb_gc_impl_latest_gc_info(void *objspace_ptr, VALUE key); GC_IMPL_FN size_t rb_gc_impl_stat(void *objspace_ptr, VALUE hash_or_sym); |
