Actions
Feature #9924
closedRevisitting GC.stat keys
Description
Now, GC.stat returns internal information abuot GC.
However, key names are from internal implementations fields,
so that it is difficult to understand what they mean.
To solve this problem, I reconsider about key names.
https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing
Any comments are welcome.
Updated by ko1 (Koichi Sasada) over 10 years ago
- Copied from Feature #9923: Revisitting GC.stat keys added
Updated by ko1 (Koichi Sasada) over 10 years ago
No objection?
Updated by ko1 (Koichi Sasada) over 10 years ago
I got Matz's approval.
Updated by ko1 (Koichi Sasada) about 10 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r47471.
- gc.c (rb_objspace_t::heap_pages): rename field names:
- used -> allocated_pages
- increment -> allocatable_pages
- length -> sorted_length
And remove unused `limt' field.
- gc.c: rename macros:
- heap_pages_used -> heap_allocated_pages
- heap_pages_length -> heap_pages_sorted_length
- heap_pages_increment -> heap_allocatable_pages
- gc.c (gc_stat_internal): fix symbol names
ref: [Feature #9924]
https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing
Yellow color fields in this table are changed. - test/ruby/test_gc.rb: catch up this change.
Updated by ko1 (Koichi Sasada) about 10 years ago
- Status changed from Closed to Open
r47472
r47473
r47474
are also related changes (and not finished).
These fixes break prorgrams depends on specific GC.stat() keys.
Any other objections?
Updated by ko1 (Koichi Sasada) about 10 years ago
- Status changed from Open to Closed
Applied in changeset r47488.
- gc.c (objspace_total_slot): rename objspace_available_slots.
- gc.c (objspace_live_slot, objspace_free_slot): rename
..._slot() to ..._slots(). - gc.c (objspace_free_slot): should subtract heap_pages_final_slots.
- gc.c (gc_stat_internal):
- add `heap_available_slots' field
- rename heap_live_slot to heap_live_slots
- rename heap_free_slot to heap_free_slots
ref: [Feature #9924]
Updated by ko1 (Koichi Sasada) about 10 years ago
- Status changed from Closed to Open
fixed.
https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing
Feedbacks are welcome.
Updated by ko1 (Koichi Sasada) about 10 years ago
- Status changed from Open to Closed
Applied in changeset r48423.
- gc.c (gc_stat_internal): add compatible layer.
From Ruby 2.2, keys of GC.stat are changed [Feature #9924].
To provide compatible layer, GC.stat add a default_proc
(if default_proc of given Hash object is not set).
At first use of this compatible layer of interpreter process,
show a warning message like that:
program: GC.stat[:total_allocated_object]
warning message: "warning: GC.stat keys were changed from Ruby
2.1. In this case, you refer to obsoletetotal_allocated_object' (new key is
total_allocated_objects').
Please check https://bugs.ruby-lang.org/issues/9924
for more information."
Pleaes correct my English message :) - hash.c (rb_hash_set_default_proc): export (in internal).
- internal.h: ditto.
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0