From 9d2f54b3e9eb242da781970c5df458611f5ec332 Mon Sep 17 00:00:00 2001 From: nari Date: Fri, 22 Nov 2013 07:26:55 +0000 Subject: [PATCH] * include/ruby/intern.h (rb_gc_set_params): Deprecate rb_gc_set_params because it's only used in ruby internal. * internal.h (ruby_gc_set_params): Declare rb_gc_set_params's alias function. * gc.c: ditto. * ruby.c: use ruby_gc_set_params. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 12 ++++++++++++ gc.c | 4 +++- include/ruby/intern.h | 2 +- internal.h | 1 + ruby.c | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 93829ca473..729d6ba769 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Fri Nov 22 16:19:52 2013 Narihiro Nakamura + + * include/ruby/intern.h (rb_gc_set_params): Deprecate + rb_gc_set_params because it's only used in ruby internal. + + * internal.h (ruby_gc_set_params): Declare rb_gc_set_params's + alias function. + + * gc.c: ditto. + + * ruby.c: use ruby_gc_set_params. + Fri Nov 22 14:55:00 2013 Kenta Murata * ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Insert rb_thread_check_ints. diff --git a/gc.c b/gc.c index f753241374..1cc08e2c6b 100644 --- a/gc.c +++ b/gc.c @@ -5260,7 +5260,7 @@ get_envparam_double(const char *name, double *default_value, double lower_bound) } void -rb_gc_set_params(void) +ruby_gc_set_params(void) { if (rb_safe_level() > 0) return; @@ -5287,6 +5287,8 @@ rb_gc_set_params(void) get_envparam_double("RUBY_GC_HEAP_OLDSPACE_GROWTH_FACTOR", &gc_params.oldspace_limit_growth_factor, 1.0); } +RUBY_ALIAS_FUNCTION_VOID(rb_gc_set_params(void), ruby_gc_set_params, (void)) + void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data) { diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 701197269b..443071414c 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -482,7 +482,7 @@ void rb_gc_call_finalizer_at_exit(void); VALUE rb_gc_enable(void); VALUE rb_gc_disable(void); VALUE rb_gc_start(void); -void rb_gc_set_params(void); +DEPRECATED(void rb_gc_set_params(void)); VALUE rb_define_finalizer(VALUE, VALUE); VALUE rb_undefine_finalizer(VALUE); /* hash.c */ diff --git a/internal.h b/internal.h index 10819a21c7..e3eb2fe810 100644 --- a/internal.h +++ b/internal.h @@ -431,6 +431,7 @@ void *ruby_mimmalloc(size_t size); void ruby_mimfree(void *ptr); void rb_objspace_set_event_hook(const rb_event_flag_t event); void rb_gc_writebarrier_remember_promoted(VALUE obj); +void ruby_gc_set_params(void); void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_ALLOC_SIZE((2)); void ruby_sized_xfree(void *x, size_t size); diff --git a/ruby.c b/ruby.c index 0532c1a08d..034425e296 100644 --- a/ruby.c +++ b/ruby.c @@ -1568,7 +1568,7 @@ process_options(int argc, char **argv, struct cmdline_options *opt) rb_define_readonly_boolean("$-a", opt->do_split); rb_set_safe_level(opt->safe_level); - rb_gc_set_params(); + ruby_gc_set_params(); return iseq; }