ruby-changes:4106
From: ko1@a...
Date: Mon, 25 Feb 2008 13:59:12 +0900 (JST)
Subject: [ruby-changes:4106] akr - Ruby:r15596 (ruby_1_8, trunk): * process.c (Init_process): share bignum objects for RLIM_INFINITY,
akr 2008-02-25 13:58:47 +0900 (Mon, 25 Feb 2008)
New Revision: 15596
Modified files:
branches/ruby_1_8/ChangeLog
branches/ruby_1_8/process.c
trunk/ChangeLog
trunk/process.c
Log:
* process.c (Init_process): share bignum objects for RLIM_INFINITY,
RLIM_SAVED_MAX and RLIM_SAVED_CUR if they are equal.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=15596&r2=15595&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15596&r2=15595&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/process.c?r1=15596&r2=15595&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/process.c?r1=15596&r2=15595&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 15595)
+++ ChangeLog (revision 15596)
@@ -1,3 +1,8 @@
+Mon Feb 25 13:40:03 2008 Tanaka Akira <akr@f...>
+
+ * 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@i...>
* encoding.c (Encoding#dummy): minor grammatical fixes
@@ -193,7 +198,7 @@
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 @@
* 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.
Index: process.c
===================================================================
--- process.c (revision 15595)
+++ process.c (revision 15596)
@@ -4023,15 +4023,18 @@
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
Index: ruby_1_8/process.c
===================================================================
--- ruby_1_8/process.c (revision 15595)
+++ ruby_1_8/process.c (revision 15596)
@@ -3630,15 +3630,18 @@
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
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog (revision 15595)
+++ ruby_1_8/ChangeLog (revision 15596)
@@ -1,3 +1,8 @@
+Mon Feb 25 13:40:03 2008 Tanaka Akira <akr@f...>
+
+ * process.c (Init_process): share bignum objects for RLIM_INFINITY,
+ RLIM_SAVED_MAX and RLIM_SAVED_CUR if they are equal.
+
Sun Feb 24 23:29:48 2008 Nobuyoshi Nakada <nobu@r...>
* common.mk, {bcc,win}32/Makefile.sub (clean-local): remove
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/