diff --git a/ChangeLog b/ChangeLog index a6d7447307..5797e3bf8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 25 13:40:03 2008 Tanaka Akira + + * process.c (Init_process): share bignum objects for RLIM_INFINITY, + RLIM_SAVED_MAX and RLIM_SAVED_CUR if they are equal. + Mon Feb 25 10:41:41 2008 Martin Duerst * encoding.c (Encoding#dummy): minor grammatical fixes @@ -193,7 +198,7 @@ Wed Feb 20 13:08:52 2008 Nobuyoshi Nakada type, for compiled files and script files. * instruby.rb (parse_args): deal with make style command line macros, - and count as long syle options if prefixed with INSTALL_. + and count as long style options if prefixed with INSTALL_. * instruby.rb (makedirs): use $dir_mode. [ruby-dev:33805] @@ -282,7 +287,7 @@ Sun Feb 17 15:25:08 2008 NARUSE, Yui * encoding.c (ENC_CODERANGE_AND): added. - * string.c (rb_str_plus, srb_str_times): keep coderange. + * string.c (rb_str_plus, rb_str_times): keep coderange. * parse.y (STR_NEW0) use rb_usascii_str_new. diff --git a/process.c b/process.c index 3ab9790c81..f3ece07dee 100644 --- a/process.c +++ b/process.c @@ -4023,15 +4023,18 @@ Init_process(void) rb_define_module_function(rb_mProcess, "getrlimit", proc_getrlimit, 1); rb_define_module_function(rb_mProcess, "setrlimit", proc_setrlimit, -1); #ifdef RLIM2NUM -#ifdef RLIM_INFINITY - rb_define_const(rb_mProcess, "RLIM_INFINITY", RLIM2NUM(RLIM_INFINITY)); -#endif + { + VALUE inf = RLIM2NUM(RLIM_INFINITY), v; + rb_define_const(rb_mProcess, "RLIM_INFINITY", inf); #ifdef RLIM_SAVED_MAX - rb_define_const(rb_mProcess, "RLIM_SAVED_MAX", RLIM2NUM(RLIM_SAVED_MAX)); + v = RLIM_INFINITY == RLIM_SAVED_MAX ? inf : RLIM2NUM(RLIM_SAVED_MAX); + rb_define_const(rb_mProcess, "RLIM_SAVED_MAX", v); #endif #ifdef RLIM_SAVED_CUR - rb_define_const(rb_mProcess, "RLIM_SAVED_CUR", RLIM2NUM(RLIM_SAVED_CUR)); + v = RLIM_INFINITY == RLIM_SAVED_CUR ? inf : RLIM2NUM(RLIM_SAVED_CUR); + rb_define_const(rb_mProcess, "RLIM_SAVED_CUR", v); #endif + } #ifdef RLIMIT_CORE rb_define_const(rb_mProcess, "RLIMIT_CORE", INT2FIX(RLIMIT_CORE)); #endif