From 5d5c95f28e9f40bbe867ce05feaa351d76fd53dd Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 14 Nov 2014 07:29:33 +0000 Subject: * 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 obsolete `total_allocated_object' (new key is `total_allocated_objects'). Please check for more information." Pleaes correct my English message :) * hash.c (rb_hash_set_default_proc): export (in internal). * internal.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- internal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'internal.h') diff --git a/internal.h b/internal.h index eb835f30d6..f106f4cfa5 100644 --- a/internal.h +++ b/internal.h @@ -671,6 +671,7 @@ void rb_gc_resurrect(VALUE ptr); /* hash.c */ struct st_table *rb_hash_tbl_raw(VALUE hash); VALUE rb_hash_has_key(VALUE hash, VALUE key); +VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc); #define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h) VALUE rb_hash_keys(VALUE hash); -- cgit v1.2.3