summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-01 03:31:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-01 03:31:05 +0000
commit2252d4ce028b38bb46310b215b2c98afbf224d55 (patch)
tree4bc848c3b8cdde1032611e27217cec98134055e2
parent6001314def338002ae1dc50bcf120805bee78a44 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--eval.c34
-rw-r--r--gc.c3
-rw-r--r--instruby.rb4
-rw-r--r--lib/matrix.rb16
-rw-r--r--version.h4
-rw-r--r--win32/win32.c8
7 files changed, 44 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 59a674a1645..0f6364dfdee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/eval.c b/eval.c
index f367322fd7f..be0303e0a41 100644
--- a/eval.c
+++ b/eval.c
@@ -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
diff --git a/gc.c b/gc.c
index fb221f2d1a3..4fd2f2ae096 100644
--- a/gc.c
+++ b/gc.c
@@ -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 e966b5bd9ab..f28dbea7b90 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 223bf708692..4821bababf6 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
diff --git a/version.h b/version.h
index 834dbd86086..91fa30f202a 100644
--- a/version.h
+++ b/version.h
@@ -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 c024ca04cb6..2bf1bb1dbc9 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 */
}