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.
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.

34
eval.c
View file

@ -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

3
gc.c
View file

@ -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];

View file

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

View file

@ -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

View file

@ -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

View file

@ -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 */
}