diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-06-29 08:32:54 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-06-29 08:32:54 +0000 |
commit | f00ea57ce1fe0bfe137d76703b1bdc4d2293c781 (patch) | |
tree | 116f8145de8f318a2f85c849b11a3c38f00c576b | |
parent | 56553684679e8160f7fdfaad746fd4b881b8ff3d (diff) |
* lex.c (rb_reserved_word): lex_state after tRESCUE should be
EXPR_MID.
* gc.c (add_heap): allocation size of the heap unit is doubled for
each allocation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | dln.c | 2 | ||||
-rw-r--r-- | eval.c | 6 | ||||
-rw-r--r-- | gc.c | 47 | ||||
-rw-r--r-- | keywords | 2 | ||||
-rw-r--r-- | lex.c | 10 | ||||
-rw-r--r-- | lib/open3.rb | 3 | ||||
-rw-r--r-- | regex.c | 1 | ||||
-rw-r--r-- | version.h | 4 |
9 files changed, 60 insertions, 25 deletions
@@ -1,3 +1,8 @@ +Fri Jun 29 15:29:31 2001 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lex.c (rb_reserved_word): lex_state after tRESCUE should be + EXPR_MID. + Thu Jun 28 00:36:19 2001 Keiju Ishitsuka <keiju@ishitsuka.com> * lib/matrix.rb: resolve 'ruby -w' warnings. @@ -23,6 +28,11 @@ Wed Jun 27 08:53:04 2001 Minero Aoki <aamine@loveruby.net> * lib/net/protocol.rb,smtp.rb,pop.rb,http.rb: add document. +Tue Jun 26 18:42:42 2001 Yukihiro Matsumoto <matz@ruby-lang.org> + + * gc.c (add_heap): allocation size of the heap unit is doubled for + each allocation. + Sat Jun 23 19:25:08 2001 Akinori MUSHA <knu@iDaemons.org> * lib/thread.rb: Synchronize with HEAD. The last change @@ -87,7 +87,7 @@ int eaccess(); #endif #ifndef FUNCNAME_PATTERN -# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && __FreeBSD__ < 3) || defined(__OpenBSD__) || defined(NeXT) || defined(__WATCOMC__) || defined(__APPLE__) +# if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && !defined(__ELF__)) || defined(__OpenBSD__) || defined(NeXT) || defined(__WATCOMC__) || defined(__APPLE__) # define FUNCNAME_PATTERN "_Init_%.200s" # else # define FUNCNAME_PATTERN "Init_%.200s" @@ -4127,15 +4127,15 @@ rb_undefined(obj, id, argc, argv, call_status) } #ifdef DJGPP -static int STACK_LEVEL_MAX = 65535; +static unsigned int STACK_LEVEL_MAX = 65535; #else #ifdef __human68k__ -extern int _stacksize; +extern unsigned int _stacksize; # define STACK_LEVEL_MAX (_stacksize - 4096) #undef HAVE_GETRLIMIT #else #ifdef HAVE_GETRLIMIT -static int STACK_LEVEL_MAX = 655300; +static unsigned int STACK_LEVEL_MAX = 655300; #else # define STACK_LEVEL_MAX 655300 #endif @@ -262,7 +262,10 @@ static RVALUE **heaps; static int heaps_length = 0; static int heaps_used = 0; -#define HEAP_SLOTS 10000 +#define HEAP_MIN_SLOTS 10000 +static int *heaps_limits; +static int heap_slots = HEAP_MIN_SLOTS; + #define FREE_MIN 4096 static RVALUE *himem, *lomem; @@ -279,13 +282,29 @@ add_heap() (RVALUE**)realloc(heaps, heaps_length*sizeof(RVALUE*)): (RVALUE**)malloc(heaps_length*sizeof(RVALUE*))); if (heaps == 0) mem_error("heaps: can't alloc memory"); + RUBY_CRITICAL(heaps_limits = (heaps_used>0)? + (int*)realloc(heaps_limits, heaps_length*sizeof(int)): + (int*)malloc(heaps_length*sizeof(int))); + if (heaps_limits == 0) mem_error("heaps_limits: can't alloc memory"); } - RUBY_CRITICAL(p = heaps[heaps_used++] = (RVALUE*)malloc(sizeof(RVALUE)*HEAP_SLOTS)); - if (p == 0) mem_error("add_heap: can't alloc memory"); - pend = p + HEAP_SLOTS; + for (;;) { + RUBY_CRITICAL(p = heaps[heaps_used] = (RVALUE*)malloc(sizeof(RVALUE)*heap_slots)); + heaps_limits[heaps_used] = heap_slots; + if (p == 0) { + if (heap_slots == HEAP_MIN_SLOTS) { + mem_error("add_heap: can't alloc memory"); + } + heap_slots = HEAP_MIN_SLOTS; + continue; + } + break; + } + pend = p + heap_slots; if (lomem == 0 || lomem > p) lomem = p; if (himem < pend) himem = pend; + heaps_used++; + heap_slots *= 2; while (p < pend) { p->as.free.flag = 0; @@ -341,8 +360,8 @@ is_pointer_to_heap(ptr) /* check if p looks like a pointer */ for (i=0; i < heaps_used; i++) { heap_org = heaps[i]; - if (heap_org <= p && p < heap_org + HEAP_SLOTS - && ((((char*)p)-((char*)heap_org))%sizeof(RVALUE)) == 0) + if (heap_org <= p && p < heap_org + heaps_limits[i] && + ((((char*)p)-((char*)heap_org))%sizeof(RVALUE)) == 0) return Qtrue; } return Qfalse; @@ -516,6 +535,8 @@ rb_gc_mark(ptr) case NODE_DEFINED: case NODE_MATCH: case NODE_RETURN: + case NODE_BREAK: + case NODE_NEXT: case NODE_YIELD: case NODE_COLON2: case NODE_ARGS: @@ -543,8 +564,6 @@ rb_gc_mark(ptr) case NODE_BACK_REF: case NODE_ALIAS: case NODE_VALIAS: - case NODE_BREAK: - case NODE_NEXT: case NODE_REDO: case NODE_RETRY: case NODE_UNDEF: @@ -680,7 +699,7 @@ gc_sweep() if (ruby_in_compile) { /* should not reclaim nodes during compilation */ for (i = 0; i < used; i++) { - p = heaps[i]; pend = p + HEAP_SLOTS; + p = heaps[i]; pend = p + heaps_limits[i]; while (p < pend) { if (!(p->as.basic.flags&FL_MARK) && BUILTIN_TYPE(p) == T_NODE) rb_gc_mark(p); @@ -695,7 +714,7 @@ gc_sweep() for (i = 0; i < used; i++) { int n = 0; - p = heaps[i]; pend = p + HEAP_SLOTS; + p = heaps[i]; pend = p + heaps_limits[i]; while (p < pend) { if (!(p->as.basic.flags & FL_MARK)) { if (p->as.basic.flags) { @@ -1049,7 +1068,7 @@ os_live_obj() for (i = 0; i < heaps_used; i++) { RVALUE *p, *pend; - p = heaps[i]; pend = p + HEAP_SLOTS; + p = heaps[i]; pend = p + heaps_limits[i]; for (;p < pend; p++) { if (p->as.basic.flags) { switch (TYPE(p)) { @@ -1082,7 +1101,7 @@ os_obj_of(of) for (i = 0; i < heaps_used; i++) { RVALUE *p, *pend; - p = heaps[i]; pend = p + HEAP_SLOTS; + p = heaps[i]; pend = p + heaps_limits[i]; for (;p < pend; p++) { if (p->as.basic.flags) { switch (TYPE(p)) { @@ -1251,7 +1270,7 @@ rb_gc_call_finalizer_at_exit() } } for (i = 0; i < heaps_used; i++) { - p = heaps[i]; pend = p + HEAP_SLOTS; + p = heaps[i]; pend = p + heaps_limits[i]; while (p < pend) { if (FL_TEST(p, FL_FINALIZE)) { FL_UNSET(p, FL_FINALIZE); @@ -1264,7 +1283,7 @@ rb_gc_call_finalizer_at_exit() } /* run data object's finaliers */ for (i = 0; i < heaps_used; i++) { - p = heaps[i]; pend = p + HEAP_SLOTS; + p = heaps[i]; pend = p + heaps_limits[i]; while (p < pend) { if (BUILTIN_TYPE(p) == T_DATA && DATA_PTR(p) && RANY(p)->as.data.dfree) { @@ -27,7 +27,7 @@ nil, kNIL, kNIL, EXPR_END not, kNOT, kNOT, EXPR_BEG or, kOR, kOR, EXPR_BEG redo, kREDO, kREDO, EXPR_END -rescue, kRESCUE, kRESCUE_MOD, EXPR_END +rescue, kRESCUE, kRESCUE_MOD, EXPR_MID retry, kRETRY, kRETRY, EXPR_END return, kRETURN, kRETURN, EXPR_MID self, kSELF, kSELF, EXPR_END @@ -1,5 +1,5 @@ -/* C code produced by gperf version 2.7.1 (19981006 egcs) */ -/* Command-line: gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$ ./keywords */ +/* C code produced by gperf version 2.7.2 */ +/* Command-line: gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' ./keywords */ struct kwtable {char *name; int id[2]; enum lex_state state;}; #define TOTAL_KEYWORDS 40 @@ -11,6 +11,10 @@ struct kwtable {char *name; int id[2]; enum lex_state state;}; #ifdef __GNUC__ __inline +#else +#ifdef __cplusplus +inline +#endif #endif static unsigned int hash (str, len) @@ -79,7 +83,7 @@ rb_reserved_word (str, len) {"module", kMODULE, kMODULE, EXPR_BEG}, {"elsif", kELSIF, kELSIF, EXPR_BEG}, {"def", kDEF, kDEF, EXPR_FNAME}, - {"rescue", kRESCUE, kRESCUE_MOD, EXPR_END}, + {"rescue", kRESCUE, kRESCUE_MOD, EXPR_MID}, {"not", kNOT, kNOT, EXPR_BEG}, {"then", kTHEN, kTHEN, EXPR_BEG}, {"yield", kYIELD, kYIELD, EXPR_ARG}, diff --git a/lib/open3.rb b/lib/open3.rb index 33701bbfc0..0bb744ab68 100644 --- a/lib/open3.rb +++ b/lib/open3.rb @@ -32,7 +32,8 @@ module Open3 exec(*cmd) } - exit! + Process.wait + exit! $?>>8 } pw[0].close @@ -3496,6 +3496,7 @@ init_regs(regs, num_regs) else if (regs->allocated < num_regs) { TREALLOC(regs->beg, num_regs, int); TREALLOC(regs->end, num_regs, int); + regs->allocated = num_regs; } for (i=0; i<num_regs; i++) { regs->beg[i] = regs->end[i] = -1; @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.6.4" -#define RUBY_RELEASE_DATE "2001-06-22" +#define RUBY_RELEASE_DATE "2001-06-29" #define RUBY_VERSION_CODE 164 -#define RUBY_RELEASE_CODE 20010622 +#define RUBY_RELEASE_CODE 20010629 |