summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ToDo1
-rw-r--r--file.c2
-rw-r--r--gc.c20
-rw-r--r--marshal.c2
-rw-r--r--missing/vsnprintf.c7
6 files changed, 13 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 39ccfcc6d8d..f4e56ab3bfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@ Fri Sep 6 12:11:22 2002 Minero Aoki <aamine@loveruby.net>
* parse.y (rb_gc_mark_parser): should mark ALL global variables
defined in parse.y.
+Fri Sep 6 01:15:23 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * gc.c (ruby_xmalloc): remove MALLOC_LIMIT to avoid frequent
+ garabage collection.
+
Fri Sep 6 11:47:37 2002 Minero Aoki <aamine@loveruby.net>
* parse.y (rb_gc_mark_parser): should mark global variables
diff --git a/ToDo b/ToDo
index 9bd0207601b..fa7f32daed0 100644
--- a/ToDo
+++ b/ToDo
@@ -106,7 +106,6 @@ Standard Libraries
* deprecate Array#indexes, and Array#indices.
* require "1.6" etc. by /usr/lib/ruby/1.6/1.6.rb ;-)
* save both "feature names" and "normalized path" in $"
-* allow marshaling of extend'ed object.
Extension Libraries
diff --git a/file.c b/file.c
index a32d962df12..8a91e20ad99 100644
--- a/file.c
+++ b/file.c
@@ -2372,7 +2372,7 @@ path_check_1(path)
&& (!p || !(st.st_mode & S_ISVTX))
#endif
) {
- rb_warn("Insecure world writable dir %s , mode 0%o", p0, st.st_mode);
+ rb_warn("Insecure world writable dir %s, mode 0%o", p0, st.st_mode);
if (p) *p = '/';
return 0;
}
diff --git a/gc.c b/gc.c
index 84842b3d66a..3ecac66abae 100644
--- a/gc.c
+++ b/gc.c
@@ -53,16 +53,6 @@ void *alloca ();
#endif
static void run_final();
-
-#ifndef GC_MALLOC_LIMIT
-#if defined(MSDOS) || defined(__human68k__)
-#define GC_MALLOC_LIMIT 200000
-#else
-#define GC_MALLOC_LIMIT 8000000
-#endif
-#endif
-
-static unsigned long malloc_memories = 0;
static VALUE nomem_error;
void
@@ -88,11 +78,7 @@ ruby_xmalloc(size)
rb_raise(rb_eNoMemError, "negative allocation size (or too big)");
}
if (size == 0) size = 1;
- malloc_memories += size;
- if (malloc_memories > GC_MALLOC_LIMIT) {
- rb_gc();
- }
RUBY_CRITICAL(mem = malloc(size));
if (!mem) {
rb_gc();
@@ -129,7 +115,6 @@ ruby_xrealloc(ptr, size)
}
if (!ptr) return xmalloc(size);
if (size == 0) size = 1;
- malloc_memories += size;
RUBY_CRITICAL(mem = realloc(ptr, size));
if (!mem) {
rb_gc();
@@ -1131,15 +1116,12 @@ rb_gc()
SET_STACK_END;
if (dont_gc || during_gc) {
- if (!freelist || malloc_memories > GC_MALLOC_LIMIT) {
- malloc_memories = 0;
+ if (!freelist) {
add_heap();
}
return;
}
- malloc_memories = 0;
-
if (during_gc) return;
during_gc++;
diff --git a/marshal.c b/marshal.c
index e6672d229ce..e52508db257 100644
--- a/marshal.c
+++ b/marshal.c
@@ -114,7 +114,7 @@ w_bytes(s, n, arg)
fwrite(s, 1, n, arg->fp);
}
else {
- rb_str_cat(arg->str, s, n);
+ rb_str_buf_cat(arg->str, s, n);
}
}
diff --git a/missing/vsnprintf.c b/missing/vsnprintf.c
index b21261d7df1..266290a139e 100644
--- a/missing/vsnprintf.c
+++ b/missing/vsnprintf.c
@@ -1018,8 +1018,11 @@ cvt(value, ndigits, flags, sign, decpt, ch, length)
if (value < 0) {
value = -value;
*sign = '-';
- } else
- *sign = '\000';
+ } else if (value == 0.0 && 1.0/value < 0) {
+ *sign = '-';
+ } else {
+ *sign = '\000';
+ }
digits = BSD__dtoa(value, mode, ndigits, decpt, &dsgn, &rve);
if (flags & ALT) { /* Print trailing zeros */
bp = digits + ndigits;