Commit 6d75f89e authored by take_cheeze's avatar take_cheeze

Support :T_FIBER in ObjectSpace.count_objects .

parent 09d1c423
......@@ -90,6 +90,7 @@ os_count_objects(mrb_state *mrb, mrb_value self)
COUNT_TYPE(T_FILE);
COUNT_TYPE(T_ENV);
COUNT_TYPE(T_DATA);
COUNT_TYPE(T_FIBER);
#undef COUNT_TYPE
default:
type = mrb_fixnum_value(i); break;
......
assert('ObjectSpace.count_objects') do
h = {}
f = Fiber.new {} if Object.const_defined? :Fiber
ObjectSpace.count_objects(h)
assert_kind_of(Hash, h)
assert_true(h.keys.all? {|x| x.is_a?(Symbol) || x.is_a?(Integer) })
......@@ -7,6 +8,7 @@ assert('ObjectSpace.count_objects') do
assert_true(h.has_key?(:TOTAL))
assert_true(h.has_key?(:FREE))
assert_true(h.has_key?(:T_FIBER)) if Object.const_defined? :Fiber
h = ObjectSpace.count_objects
assert_kind_of(Hash, h)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment