summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-25 04:58:47 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-25 04:58:47 +0000
commit84c9041f9bd6f0331592be1a6dc105f822e3e01c (patch)
treee9c2410df6ae6ff13bde6df28ffa74f0cc9bdbb9
parentad3577b59b7ba2b3f533bfcb697492fc9f56762f (diff)
* process.c (Init_process): share bignum objects for RLIM_INFINITY,
RLIM_SAVED_MAX and RLIM_SAVED_CUR if they are equal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--process.c13
2 files changed, 15 insertions, 7 deletions
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 <akr@fsij.org>
+
+ * 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 <duerst@it.aoyama.ac.jp>
* encoding.c (Encoding#dummy): minor grammatical fixes
@@ -193,7 +198,7 @@ Wed Feb 20 13:08:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
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 <naruse@ruby-lang.org>
* 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