1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* gc.c (rb_memerror): exit with EXIT_FAILURE instead of magic number.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-06-13 05:24:40 +00:00
parent 043222ba7c
commit 2cec384adc
2 changed files with 14 additions and 2 deletions

View file

@ -1,4 +1,6 @@
Fri Jun 13 14:19:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
Fri Jun 13 14:24:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (rb_memerror): exit with EXIT_FAILURE instead of magic number.
* gc.c (CHECK_STACK): STACK_LENGTH should be less than
STACK_LEVEL_MAX.

12
gc.c
View file

@ -22,6 +22,16 @@
#include <setjmp.h>
#include <sys/types.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@ -85,7 +95,7 @@ rb_memerror()
if (!nomem_error || (recurse > 0 && rb_safe_level() < 4)) {
fprintf(stderr, "[FATAL] failed to allocate memory\n");
exit(1);
exit(EXIT_FAILURE);
}
recurse++;
rb_exc_raise(nomem_error);