diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | eval.c | 34 | ||||
-rw-r--r-- | gc.c | 3 | ||||
-rw-r--r-- | instruby.rb | 4 | ||||
-rw-r--r-- | lib/matrix.rb | 16 | ||||
-rw-r--r-- | version.h | 4 | ||||
-rw-r--r-- | win32/win32.c | 8 |
7 files changed, 44 insertions, 31 deletions
@@ -1,7 +1,11 @@ -Thu Aug 31 18:07:14 2000 Yukihiro Matsumoto <matz@ruby-lang.org> +Fri Sep 1 10:36:45 2000 Yukihiro Matsumoto <matz@ruby-lang.org> * stable version 1.6.0 released. +Fri Sep 1 10:36:29 2000 Yukihiro Matsumoto <matz@ruby-lang.org> + + * eval.c (POP_SCOPE): frees scope too much. + Thu Aug 31 14:28:39 2000 Yukihiro Matsumoto <matz@ruby-lang.org> * gc.c (rb_gc_mark): T_SCOPE condition must be more precise. @@ -798,13 +798,12 @@ static rb_thread_t curr_thread = 0; if (ruby_scope->flag & SCOPE_DONT_RECYCLE) {\ if (_old) _old->flag |= SCOPE_DONT_RECYCLE;\ } \ - else { \ - if (ruby_scope->flag == SCOPE_ALLOCA) {\ - ruby_scope->local_vars = 0; \ - ruby_scope->local_tbl = 0; \ - if (ruby_scope != top_scope)\ - rb_gc_force_recycle((VALUE)ruby_scope);\ - } \ + if (!(ruby_scope->flag & SCOPE_MALLOC)) {\ + ruby_scope->local_vars = 0; \ + ruby_scope->local_tbl = 0; \ + if (ruby_scope != top_scope) { \ + rb_gc_force_recycle((VALUE)ruby_scope);\ + } \ } \ ruby_scope->flag |= SCOPE_NOSTACK; \ ruby_scope = _old; \ @@ -3451,6 +3450,7 @@ rb_yield_0(val, self, klass, acheck) switch (state) { case TAG_REDO: state = 0; + CHECK_INTS; goto redo; case TAG_NEXT: state = 0; @@ -5685,17 +5685,17 @@ scope_dup(scope) ID *tbl; VALUE *vars; - if (!(scope->flag & SCOPE_MALLOC)) { - if (scope->local_tbl) { - tbl = scope->local_tbl; - vars = ALLOC_N(VALUE, tbl[0]+1); - *vars++ = scope->local_vars[-1]; - MEMCPY(vars, scope->local_vars, VALUE, tbl[0]); - scope->local_vars = vars; - scope->flag = SCOPE_MALLOC; - } - } scope->flag |= SCOPE_DONT_RECYCLE; + if (scope->flag & SCOPE_MALLOC) return; + + if (scope->local_tbl) { + tbl = scope->local_tbl; + vars = ALLOC_N(VALUE, tbl[0]+1); + *vars++ = scope->local_vars[-1]; + MEMCPY(vars, scope->local_vars, VALUE, tbl[0]); + scope->local_vars = vars; + scope->flag |= SCOPE_MALLOC; + } } static void @@ -620,8 +620,7 @@ rb_gc_mark(ptr) break; case T_SCOPE: - if (obj->as.scope.local_vars && - (obj->as.scope.flag & SCOPE_MALLOC) != 0) { + if (obj->as.scope.local_vars && (obj->as.scope.flag & SCOPE_MALLOC)) { int n = obj->as.scope.local_tbl[0]+1; VALUE *vars = &obj->as.scope.local_vars[-1]; diff --git a/instruby.rb b/instruby.rb index e966b5bd9a..f28dbea7b9 100644 --- a/instruby.rb +++ b/instruby.rb @@ -1,6 +1,6 @@ -#!./miniruby -I. +#!./miniruby -require "rbconfig.rb" +load "./rbconfig.rb" include Config destdir = ARGV[0] || '' diff --git a/lib/matrix.rb b/lib/matrix.rb index 223bf70869..4821bababf 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -612,8 +612,12 @@ class Matrix def rank if column_size > row_size a = transpose.to_a + a_column_size = row_size + a_row_size = column_size else a = to_a + a_column_size = column_size + a_row_size = row_size end rank = 0 k = 0 @@ -622,7 +626,7 @@ class Matrix i = k exists = true begin - if (i += 1) > column_size - 1 + if (i += 1) > a_column_size - 1 exists = false break end @@ -634,13 +638,13 @@ class Matrix i = k exists = true begin - if (i += 1) > row_size - 1 + if (i += 1) > a_row_size - 1 exists = false break end end while a[k][i] == 0 if exists - k.upto(column_size - 1) do + k.upto(a_column_size - 1) do |j| a[j][k], a[j][i] = a[j][i], a[j][k] end @@ -650,16 +654,16 @@ class Matrix end end end - (k + 1).upto(row_size - 1) do + (k + 1).upto(a_row_size - 1) do |i| q = a[i][k] / akk - (k + 1).upto(column_size - 1) do + (k + 1).upto(a_column_size - 1) do |j| a[i][j] -= a[k][j] * q end end rank += 1 - end while (k += 1) <= column_size - 1 + end while (k += 1) <= a_column_size - 1 return rank end @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.6.0" -#define RUBY_RELEASE_DATE "2000-08-31" +#define RUBY_RELEASE_DATE "2000-09-01" #define RUBY_VERSION_CODE 160 -#define RUBY_RELEASE_CODE 20000831 +#define RUBY_RELEASE_CODE 20000901 diff --git a/win32/win32.c b/win32/win32.c index c024ca04cb..2bf1bb1dbc 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1562,8 +1562,10 @@ typedef struct { long osfhnd; /* underlying OS file HANDLE */ char osfile; /* attributes of file (e.g., open in text mode?) */ char pipech; /* one char buffer for handles opened on pipes */ +#ifdef _MT int lockinitflag; CRITICAL_SECTION lock; +#endif } ioinfo; #if !defined _CRTIMP @@ -1596,7 +1598,9 @@ _alloc_osfhnd(void) CloseHandle(hF); if (fh == -1) return fh; +#ifdef _MT EnterCriticalSection(&(_pioinfo(fh)->lock)); +#endif return fh; } @@ -1631,7 +1635,9 @@ my_open_osfhandle(long osfhandle, int flags) fileflags |= FOPEN; /* mark as open */ _osfile(fh) = fileflags; /* set osfile entry */ -// _unlock_fhandle(fh); +#ifdef _MT + LeaveCriticalSection(&_pioinfo(fh)->lock); +#endif return fh; /* return handle */ } |