Skip to content

Commit

Permalink
increase GC.limit for 64-bit systems and fixed nasty GC bug in eval_s…
Browse files Browse the repository at this point in the history
…lit()
  • Loading branch information
brentr committed Feb 26, 2009
1 parent 6f882b0 commit 9cd4c84
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
@@ -1,3 +1,11 @@
Tue Feb 25 00:01:19 2009 Brent Roman <brent@mbari.org>

* gc.c: default GC.limit is now 2e6*sizeof(VALUE)

* eval.c: added RB_GC_GUARDs to eval_slit(), more volatile tweaks

* version.h: bumped date, MBARI version 7A --> 8A

Tue Feb 24 00:01:19 2009 Brent Roman <brent@mbari.org>

* cofigure.in: added --enable-mbari-api and --with-wipe-sites
Expand Down
28 changes: 17 additions & 11 deletions eval.c
Expand Up @@ -1147,10 +1147,11 @@ static void scope_dup _((struct SCOPE *));
} while (0)

static VALUE rb_eval _((VALUE,NODE*));
static VALUE eval _((VALUE,VALUE,VALUE,const char*,int));
static VALUE eval _((VALUE,VALUE,volatile VALUE,const char* volatile,int));
static NODE *compile _((VALUE, const char*, int));

static VALUE rb_yield_0 _((VALUE, VALUE, VALUE, int, int));
static VALUE rb_yield_0
_((volatile VALUE, volatile VALUE, VALUE, int, volatile int));

#if STACK_WIPE_SITES & 0x20
#define wipeBeforeYield() rb_gc_wipe_stack()
Expand All @@ -1166,7 +1167,7 @@ static VALUE rb_yield_0 _((VALUE, VALUE, VALUE, int, int));
#define YIELD_FUNC_LAMBDA 3

static VALUE rb_call _((VALUE,VALUE,ID,int,const VALUE*,int,VALUE));
static VALUE module_setup _((VALUE,NODE*));
static VALUE module_setup _((VALUE,NODE *volatile));

static VALUE massign _((VALUE,NODE*,VALUE,int));
static void assign _((VALUE,NODE*,VALUE,int));
Expand Down Expand Up @@ -1259,10 +1260,10 @@ set_backtrace(info, bt)
static void
error_print()
{
volatile VALUE errat = Qnil;
VALUE errat = Qnil;
volatile VALUE eclass, e;
const char * volatile einfo;
volatile long elen;
const char * einfo;
long elen;

if (NIL_P(ruby_errinfo)) return;

Expand Down Expand Up @@ -3582,9 +3583,12 @@ eval_node(slit, VALUE)
}
switch (nd_type(node)) {
case NODE_DREGX:
return rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
str2 = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
node->nd_cflag);
RB_GC_GUARD(str); /* prevent tail call optimization here */
return str2;
case NODE_DREGX_ONCE: /* regexp expand once */
RB_GC_GUARD(str); /* ensure str remains "live" until this fn returns */
str2 = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
node->nd_cflag);
nd_set_type(node, NODE_LIT);
Expand Down Expand Up @@ -4702,7 +4706,7 @@ rb_iter_break()
break_jump(Qnil);
}

NORETURN(static void rb_longjmp _((int, VALUE)));
NORETURN(static void rb_longjmp _((volatile int, volatile VALUE)));
static VALUE make_backtrace _((void));

static void
Expand Down Expand Up @@ -5068,10 +5072,12 @@ rb_need_block()

static VALUE
rb_yield_0(val, self, klass, flags, avalue)
VALUE val, self, klass;
int flags, avalue;
volatile VALUE val, self;
VALUE klass;
int flags;
volatile int avalue;
{
NODE *node, *var;
NODE *var, *volatile node;
volatile VALUE result = Qnil;
volatile VALUE old_cref;
volatile VALUE old_wrapper;
Expand Down
2 changes: 1 addition & 1 deletion gc.c
Expand Up @@ -43,7 +43,7 @@ int _setjmp(), _longjmp();
#if defined(MSDOS) || defined(__human68k__)
#define GC_MALLOC_LIMIT 200000
#else
#define GC_MALLOC_LIMIT 8000000
#define GC_MALLOC_LIMIT (2000000*sizeof(VALUE))
#endif
#endif

Expand Down
8 changes: 4 additions & 4 deletions version.h
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.7"
#define RUBY_RELEASE_DATE "2009-2-24"
#define RUBY_RELEASE_DATE "2009-2-25"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20090224
#define RUBY_RELEASE_CODE 20090225
#define RUBY_PATCHLEVEL 72

#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 7
#define RUBY_RELEASE_YEAR 2009
#define RUBY_RELEASE_MONTH 2
#define RUBY_RELEASE_DAY 24
#define RUBY_RELEASE_DAY 25

#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];
Expand All @@ -35,7 +35,7 @@ RUBY_EXTERN const char *ruby_copyright;
#define _mbari_rev_ "mbari"
#endif

#define MBARI_RELEASE(wipe_sites) _mbari_rev_ " 7A/" string_arg(wipe_sites)
#define MBARI_RELEASE(wipe_sites) _mbari_rev_ " 8A/" string_arg(wipe_sites)

#define RUBY_RELEASE_STR MBARI_RELEASE(STACK_WIPE_SITES) " on patchlevel"
#define RUBY_RELEASE_NUM RUBY_PATCHLEVEL
Expand Down

0 comments on commit 9cd4c84

Please sign in to comment.