From 50cb7f0d1d99999654ec93cd9795aff9ac9bffbd Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 29 Dec 2025 10:47:41 -0500 Subject: [PATCH] Remove ObjectSpace.count_nodes I want to remove ObjectSpace.count_nodes in https://github.com/ruby/ruby/pull/15766. ObjectSpace.count_nodes been a no-op and returning an empty hash since Ruby 2.5 because parser nodes are not GC managed. --- stdlib/objspace/0/objspace.rbs | 23 ----------------------- test/stdlib/ObjectSpace_test.rb | 11 ----------- 2 files changed, 34 deletions(-) diff --git a/stdlib/objspace/0/objspace.rbs b/stdlib/objspace/0/objspace.rbs index cdd89a3cb..2e3732ece 100644 --- a/stdlib/objspace/0/objspace.rbs +++ b/stdlib/objspace/0/objspace.rbs @@ -126,29 +126,6 @@ module ObjectSpace # def self?.count_imemo_objects: (?Hash[Symbol, Integer] result_hash) -> Hash[Symbol, Integer] - # - # Counts nodes for each node type. - # - # This method is only for MRI developers interested in performance and memory - # usage of Ruby programs. - # - # It returns a hash as: - # - # {:NODE_METHOD=>2027, :NODE_FBODY=>1927, :NODE_CFUNC=>1798, ...} - # - # If the optional argument, result_hash, is given, it is overwritten and - # returned. This is intended to avoid probe effect. - # - # Note: The contents of the returned hash is implementation defined. It may be - # changed in future. - # - # This method is only expected to work with C Ruby. - # - def self?.count_nodes: (?Hash[Symbol, Integer] result_hash) -> Hash[Symbol, Integer] - #