summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-21 11:30:24 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-21 11:30:24 +0000
commit885d781abcfce71458b705d227cb719b8d045214 (patch)
tree83582e2545ff4ad7e3c37770bf0dae3bbce94e61 /symbol.c
parent18d8ba2594fda072bb8308f096bbe30c52b92d3c (diff)
* ext/objspace/objspace.c: add a new method ObjectSpace.count_symbols.
[Feature #11158] * symbol.c (rb_sym_immortal_count): added to count immortal symbols. * symbol.h: ditto. * test/objspace/test_objspace.rb: add a test for this method. * NEWS: describe about this method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/symbol.c b/symbol.c
index 0167fd8dcb..cd67c53663 100644
--- a/symbol.c
+++ b/symbol.c
@@ -864,6 +864,12 @@ rb_sym_all_symbols(void)
return ary;
}
+size_t
+rb_sym_immortal_count(void)
+{
+ return (size_t)global_symbols.last_id;
+}
+
int
rb_is_const_id(ID id)
{