mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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/branches/ruby_1_8@15596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
56faedc99d
commit
acfeeb2259
2 changed files with 13 additions and 5 deletions
|
@ -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.
|
||||
|
||||
Sun Feb 24 23:29:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* common.mk, {bcc,win}32/Makefile.sub (clean-local): remove
|
||||
|
|
13
process.c
13
process.c
|
@ -3630,15 +3630,18 @@ Init_process()
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue