Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

increase GC.limit for 64-bit systems and fixed nasty GC bug in eval_s…

…lit()
  • Loading branch information...
commit 9cd4c84d4d8411364bbbe21c3e8963472f7b8e26 1 parent 6f882b0
@brentr authored
Showing with 30 additions and 16 deletions.
  1. +8 −0 ChangeLog
  2. +17 −11 eval.c
  3. +1 −1  gc.c
  4. +4 −4 version.h
View
8 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
View
28 eval.c
@@ -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()
@@ -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));
@@ -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;
@@ -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);
@@ -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
@@ -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;
View
2  gc.c
@@ -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
View
8 version.h
@@ -1,7 +1,7 @@
#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
@@ -9,7 +9,7 @@
#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[];
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.