[#15841] abstract method — Tanaka Akira <akr@...17n.org>
最近、abstract method が欲しくなり、次のようなものを書きました。
[#15846] Ruby M17N request — "K.Kosako" <kosako@...>
今書いているライブラリを、あらかじめRuby M17Nに対応させておこうとして、
まつもと ゆきひろです
Yukihiro Matsumotoさんの<1012831868.125952.28017.nullmailer@ev.netlab.jp>から
<20020205045749.0AAA015B@helium.ruby-lang.org>から
At Mon, 25 Feb 2002 19:57:05 +0900,
At Mon, 25 Feb 2002 21:00:46 +0900,
まつもと ゆきひろです
まつもと ゆきひろです
Yukihiro Matsumotoさんの<1014656883.878972.23459.nullmailer@ev.netlab.jp>から
At Mon, 25 Feb 2002 19:57:05 +0900,
At Sun, 3 Mar 2002 07:15:40 +0900,
まつもと ゆきひろです
Yukihiro Matsumotoさんの<1015574625.778743.29060.nullmailer@ev.netlab.jp>から
まつもと ゆきひろです
なかだです。
nobu.nakada@nifty.ne.jpさんの
なかだです。
nobu.nakada@nifty.ne.jpさんの
なかだです。
なかだです。
nobu.nakada@nifty.ne.jpさんの
あおきです。
なかだです。
[#15855] Re: [ruby-cvs] ruby: * io.c (fptr_finalize): should raise error when fclose fails. — nobu.nakada@...
なかだです。
[#15861] syscall — nobu.nakada@...
なかだです。
西山和広です。
なかだです。
In article <200202091509.g19F9mO16072@sharui.nakada.kanuma.tochigi.jp>,
まつもと ゆきひろです
なかだです。
[#15867] [BUG?] include after module definition and extend module — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
In article <1014021831.527593.5892.nullmailer@ev.netlab.jp>,
まつもと ゆきひろです
In article <1014100898.366150.14204.nullmailer@ev.netlab.jp>,
まつもと ゆきひろです
In article <1014126659.698034.15364.nullmailer@ev.netlab.jp>,
[#15903] -L option in extmk.rb — nobu.nakada@...
なかだです。
[#15914] making net/*.rb grok URI — "Akinori MUSHA" <knu@...>
net/*.rb モジュール群をぜひとも標準添付となった URI クラスに
At Mon, 18 Feb 2002 04:33:42 +0900,
あおきです。
At Mon, 18 Feb 2002 15:24:22 +0900,
あおきです。
高橋征義です。
In article <200202190432.NAA18796@mx.inac.co.jp>,
高橋征義です。
In article <20020221020159R.maki@rubycolor.org>,
なかだです。
In article <200202202350.g1KNoc731179@sharui.nakada.kanuma.tochigi.jp>,
なかだです。
In article <200202210553.g1L5rk713061@sharui.nakada.kanuma.tochigi.jp>,
まつもと ゆきひろです
In article <1014277711.428770.25909.nullmailer@ev.netlab.jp>,
[#15918] win32 方面 — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#15988] Re: [rubyist:1097] Re: % 記法 — nobu.nakada@...
なかだです。
なかだです。
西山和広です。
まつもと ゆきひろです
なかだです。
[#15994] subdir in mkmf.rb — nobu.nakada@...
なかだです。
[#16040] Digest::MD5 SEGV (ruby_1_6) — m_seki@...
[#16049] defined? autoload constant — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
なかだです。
けいじゅ@日本ラショナルソフトウェアです.
なかだです。
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
まつもと ゆきひろです
けいじゅ@日本ラショナルソフトウェアです.
[#16050] ParseDate.to_time — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#16059] New Struct — Shin-ichiro HARA <sinara@...>
原です。
[#16068] UNIXSocket#{send_io,recv_io} — Tanaka Akira <akr@...17n.org>
しばらく前にふと気が向いて UNIXSocket#{send_io,recv_io} というものをでっ
まつもと ゆきひろです
In article <1014700933.711454.28068.nullmailer@ev.netlab.jp>,
まつもと ゆきひろです
[#16082] Array#select without block — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
新井です。
まつもと ゆきひろです
[#16102] No trace_func event at if-elsif-else line — "NAKAMURA, Hiroshi" <nakahiro@...>
なひです。
まつもと ゆきひろです
なひです。
まつもと ゆきひろです
なひです。
まつもと ゆきひろです
なひです。
まつもと ゆきひろです
なひです。どうせ一年も先の話なのでのんびりと。
まつもと ゆきひろです
なひです。
まつもと ゆきひろです
なひです。
まつもと ゆきひろです
なひです。
[#16112] ruby 1.6.7 preview 1 — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#16126] patch for gdbm, dbm and sdbm — Koji Arai <JCA02266@...>
新井です。
[#16134] Defining (Python) Source Code Encoding — TAKAHASHI Masayoshi <maki@...>
高橋征義です。ruby-list の「localized document」ともやや関係あり?
新井です。
なかだです。
[#16138] Hash implementation — MORITA Naoyuki <naohaq@...>
はじめまして、森田と申すものです。
[#16145] ruby 1.6.7 (2002-02-27)/marshal data too short (ArgumentError) — m_seki@...
[ruby-dev:15894] Re: GC after load
なかだです。
At Fri, 15 Feb 2002 11:58:06 +0900,
Nobuyoshi-Nakada wrote:
> あるいは、parse.yのmalloc()とかを置き換えてマークするとか。
激しく使い物にならなかったので、parse.yだけ再度。byaccでmake
testとrubiconまでは一応確認済み。
Index: parse.y
===================================================================
RCS file: /cvs/ruby/src/ruby/parse.y,v
retrieving revision 1.153
diff -u -2 -p -r1.153 parse.y
--- parse.y 2002/02/14 08:47:58 1.153
+++ parse.y 2002/02/15 10:29:44
@@ -149,4 +149,87 @@ static void top_local_init();
static void top_local_setup();
+#if !(defined YYBISON && defined HAVE_ALLOCA)
+
+static struct {
+ void **ptr;
+ int count;
+} stacks;
+
+static void **
+stack_holder(ptr)
+ void *ptr;
+{
+ int i;
+ if (!stacks.ptr) {
+ stacks.count = 4;
+ stacks.ptr = ALLOC_N(void*, stacks.count);
+ MEMZERO(stacks.ptr, void*, stacks.count);
+ return stacks.ptr;
+ }
+ for (i = 0; i < stacks.count; ++i) {
+ if (stacks.ptr[i] == ptr) return &stacks.ptr[i];
+ }
+ if (ptr) {
+ for (i = 0; i < stacks.count; ++i) {
+ if (!stacks.ptr[i]) return &stacks.ptr[i];
+ }
+ }
+ i = stacks.count << 1;
+ REALLOC_N(stacks.ptr, void*, i);
+ MEMZERO(stacks.ptr + stacks.count, void*, i - stacks.count);
+ stacks.count = i;
+ return &stacks.ptr[i];
+}
+
+static inline void *
+parser_malloc(size)
+ int size;
+{
+#if defined YYBISON && defined YYSTACK_USE_ALLOCA
+ return xmalloc(size);
+#else
+ void **holder = stack_holder(0);
+ VALUE *p = (VALUE *)xmalloc(size + sizeof(VALUE));
+ memset(p + 1, 0, size);
+ *holder = p;
+ *p = size;
+ return p + 1;
+#endif
+}
+
+static inline void *
+parser_realloc(ptr, size)
+ void *ptr;
+ int size;
+{
+#if defined YYBISON && defined YYSTACK_USE_ALLOCA
+ return xrealloc(ptr, size);
+#else
+ void **holder = stack_holder(ptr);
+ VALUE oldsize = *holder ? *(VALUE *)*holder : 0;
+ VALUE *p = (VALUE *)xrealloc(ptr, size + sizeof(VALUE));
+ if (size > oldsize) memset(p + 1 + oldsize, 0, size - oldsize);
+ *holder = p;
+ *p = size;
+ return p + 1;
+#endif
+}
+
+static inline void
+parser_free(ptr)
+ void *ptr;
+{
+#if !(defined YYBISON && defined YYSTACK_USE_ALLOCA)
+ *stack_holder(ptr) = 0;
+#endif
+ xfree(ptr);
+}
+
+#define malloc(size) parser_malloc(size)
+#define calloc(size) parser_calloc(size)
+#define realloc(ptr, size) parser_realloc(ptr, size)
+#define free(ptr) parser_free(ptr)
+#endif
+
%}
@@ -2115,4 +2198,22 @@ int ruby__end__seen;
static VALUE ruby_debug_lines;
+void
+rb_gc_mark_parser()
+{
+#if defined YYBISON && defined HAVE_ALLOCA
+ if (!ruby_in_compile) return;
+ rb_gc_mark_maybe(yylval.val);
+#else
+ int i;
+ if (!ruby_in_compile || !stacks.ptr) return;
+ rb_gc_mark_maybe(yylval.val);
+ for (i = 0; i < stacks.count; ++i) {
+ VALUE *p = stacks.ptr[i];
+ if (!p || !*p) continue;
+ rb_gc_mark_locations(p + 1, (VALUE *)((char *)p + *p));
+ }
+#endif
+}
+
static NODE*
yycompile(f, line)
@@ -2162,4 +2263,6 @@ yycompile(f, line)
cur_mid = 0;
+ rb_gc_finalize_deferred();
+
if (n == 0) node = ruby_eval_tree;
return node;
@@ -2890,5 +2993,5 @@ here_document(term, indent)
ruby_sourceline = linesave;
rb_compile_error("can't find string \"%s\" anywhere before EOF", eos);
- free(eos);
+ xfree(eos);
return 0;
}
@@ -2941,5 +3044,5 @@ here_document(term, indent)
}
}
- free(eos);
+ xfree(eos);
lex_lastline = lastline_save;
lex_pbeg = RSTRING(lex_lastline)->ptr;
@@ -4915,8 +5018,8 @@ local_pop()
if (lvtbl->tbl) {
- if (!lvtbl->nofree) free(lvtbl->tbl);
+ if (!lvtbl->nofree) xfree(lvtbl->tbl);
else lvtbl->tbl[0] = lvtbl->cnt;
}
- free(lvtbl);
+ xfree(lvtbl);
lvtbl = local;
}
@@ -5026,5 +5139,5 @@ top_local_setup()
}
if (ruby_scope->local_tbl && ruby_scope->local_vars[-1] == 0) {
- free(ruby_scope->local_tbl);
+ xfree(ruby_scope->local_tbl);
}
ruby_scope->local_vars[-1] = 0;
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦