1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-09-01 03:31:05 +00:00
parent 6001314def
commit 2252d4ce02
7 changed files with 44 additions and 31 deletions

View file

@ -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. * 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> 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. * gc.c (rb_gc_mark): T_SCOPE condition must be more precise.

14
eval.c
View file

@ -798,11 +798,10 @@ static rb_thread_t curr_thread = 0;
if (ruby_scope->flag & SCOPE_DONT_RECYCLE) {\ if (ruby_scope->flag & SCOPE_DONT_RECYCLE) {\
if (_old) _old->flag |= SCOPE_DONT_RECYCLE;\ if (_old) _old->flag |= SCOPE_DONT_RECYCLE;\
} \ } \
else { \ if (!(ruby_scope->flag & SCOPE_MALLOC)) {\
if (ruby_scope->flag == SCOPE_ALLOCA) {\
ruby_scope->local_vars = 0; \ ruby_scope->local_vars = 0; \
ruby_scope->local_tbl = 0; \ ruby_scope->local_tbl = 0; \
if (ruby_scope != top_scope)\ if (ruby_scope != top_scope) { \
rb_gc_force_recycle((VALUE)ruby_scope);\ rb_gc_force_recycle((VALUE)ruby_scope);\
} \ } \
} \ } \
@ -3451,6 +3450,7 @@ rb_yield_0(val, self, klass, acheck)
switch (state) { switch (state) {
case TAG_REDO: case TAG_REDO:
state = 0; state = 0;
CHECK_INTS;
goto redo; goto redo;
case TAG_NEXT: case TAG_NEXT:
state = 0; state = 0;
@ -5685,17 +5685,17 @@ scope_dup(scope)
ID *tbl; ID *tbl;
VALUE *vars; VALUE *vars;
if (!(scope->flag & SCOPE_MALLOC)) { scope->flag |= SCOPE_DONT_RECYCLE;
if (scope->flag & SCOPE_MALLOC) return;
if (scope->local_tbl) { if (scope->local_tbl) {
tbl = scope->local_tbl; tbl = scope->local_tbl;
vars = ALLOC_N(VALUE, tbl[0]+1); vars = ALLOC_N(VALUE, tbl[0]+1);
*vars++ = scope->local_vars[-1]; *vars++ = scope->local_vars[-1];
MEMCPY(vars, scope->local_vars, VALUE, tbl[0]); MEMCPY(vars, scope->local_vars, VALUE, tbl[0]);
scope->local_vars = vars; scope->local_vars = vars;
scope->flag = SCOPE_MALLOC; scope->flag |= SCOPE_MALLOC;
} }
}
scope->flag |= SCOPE_DONT_RECYCLE;
} }
static void static void

3
gc.c
View file

@ -620,8 +620,7 @@ rb_gc_mark(ptr)
break; break;
case T_SCOPE: case T_SCOPE:
if (obj->as.scope.local_vars && if (obj->as.scope.local_vars && (obj->as.scope.flag & SCOPE_MALLOC)) {
(obj->as.scope.flag & SCOPE_MALLOC) != 0) {
int n = obj->as.scope.local_tbl[0]+1; int n = obj->as.scope.local_tbl[0]+1;
VALUE *vars = &obj->as.scope.local_vars[-1]; VALUE *vars = &obj->as.scope.local_vars[-1];

View file

@ -1,6 +1,6 @@
#!./miniruby -I. #!./miniruby
require "rbconfig.rb" load "./rbconfig.rb"
include Config include Config
destdir = ARGV[0] || '' destdir = ARGV[0] || ''

View file

@ -612,8 +612,12 @@ class Matrix
def rank def rank
if column_size > row_size if column_size > row_size
a = transpose.to_a a = transpose.to_a
a_column_size = row_size
a_row_size = column_size
else else
a = to_a a = to_a
a_column_size = column_size
a_row_size = row_size
end end
rank = 0 rank = 0
k = 0 k = 0
@ -622,7 +626,7 @@ class Matrix
i = k i = k
exists = true exists = true
begin begin
if (i += 1) > column_size - 1 if (i += 1) > a_column_size - 1
exists = false exists = false
break break
end end
@ -634,13 +638,13 @@ class Matrix
i = k i = k
exists = true exists = true
begin begin
if (i += 1) > row_size - 1 if (i += 1) > a_row_size - 1
exists = false exists = false
break break
end end
end while a[k][i] == 0 end while a[k][i] == 0
if exists if exists
k.upto(column_size - 1) do k.upto(a_column_size - 1) do
|j| |j|
a[j][k], a[j][i] = a[j][i], a[j][k] a[j][k], a[j][i] = a[j][i], a[j][k]
end end
@ -650,16 +654,16 @@ class Matrix
end end
end end
end end
(k + 1).upto(row_size - 1) do (k + 1).upto(a_row_size - 1) do
|i| |i|
q = a[i][k] / akk q = a[i][k] / akk
(k + 1).upto(column_size - 1) do (k + 1).upto(a_column_size - 1) do
|j| |j|
a[i][j] -= a[k][j] * q a[i][j] -= a[k][j] * q
end end
end end
rank += 1 rank += 1
end while (k += 1) <= column_size - 1 end while (k += 1) <= a_column_size - 1
return rank return rank
end end

View file

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.0" #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_VERSION_CODE 160
#define RUBY_RELEASE_CODE 20000831 #define RUBY_RELEASE_CODE 20000901

View file

@ -1562,8 +1562,10 @@ typedef struct {
long osfhnd; /* underlying OS file HANDLE */ long osfhnd; /* underlying OS file HANDLE */
char osfile; /* attributes of file (e.g., open in text mode?) */ char osfile; /* attributes of file (e.g., open in text mode?) */
char pipech; /* one char buffer for handles opened on pipes */ char pipech; /* one char buffer for handles opened on pipes */
#ifdef _MT
int lockinitflag; int lockinitflag;
CRITICAL_SECTION lock; CRITICAL_SECTION lock;
#endif
} ioinfo; } ioinfo;
#if !defined _CRTIMP #if !defined _CRTIMP
@ -1596,7 +1598,9 @@ _alloc_osfhnd(void)
CloseHandle(hF); CloseHandle(hF);
if (fh == -1) if (fh == -1)
return fh; return fh;
#ifdef _MT
EnterCriticalSection(&(_pioinfo(fh)->lock)); EnterCriticalSection(&(_pioinfo(fh)->lock));
#endif
return fh; return fh;
} }
@ -1631,7 +1635,9 @@ my_open_osfhandle(long osfhandle, int flags)
fileflags |= FOPEN; /* mark as open */ fileflags |= FOPEN; /* mark as open */
_osfile(fh) = fileflags; /* set osfile entry */ _osfile(fh) = fileflags; /* set osfile entry */
// _unlock_fhandle(fh); #ifdef _MT
LeaveCriticalSection(&_pioinfo(fh)->lock);
#endif
return fh; /* return handle */ return fh; /* return handle */
} }