これかー
2004-12-22 Paul Eggert <eggert@cs.ucla.edu> * NEWS: Bison-generated parsers no longer default to using the alloca function (when available) to extend the parser stack, due to widespread problems in unchecked stack-overflow detection.
うーむ、パース後に GC を起動するのはできるだけ避けたいしなあ。 パーサスタックを Ruby から取る方法があれば一番いいんだよな。 調べてみよう。
(13:27)
> Macro: YYSTACK_USE_ALLOCA > > Macro used to control the use of alloca when the C LALR(1) parser needs to > extend its stacks. If defined to 0, the parser will use malloc to extend > its stacks. If defined to 1, the parser will use alloca. Values other than > 0 and 1 are reserved for future Bison extensions. If not defined, > YYSTACK_USE_ALLOCA defaults to 0. > > If you define YYSTACK_USE_ALLOCA to 1, it is your responsibility to make > sure that alloca is visible, e.g., by using GCC or by including <stdlib.h>. > Furthermore, in the all-too-common case where your code may run on a host > with a limited stack and with unreliable stack-overflow checking, you > should set YYMAXDEPTH to a value that cannot possibly result in unchecked > stack overflow on any of your target hosts when alloca is called. You can > inspect the code that Bison generates in order to determine the proper > numeric values. This will require some expertise in low-level > implementation details.
と、いうことらしいですよ。うーむ。
うわあ、パーサスケルトンが m4 になってる。 きみらどうしてそんなに m4 が好きなんだ。
(14:01)
Copyright (c) 2002-2007 青木峰郎 / Minero Aoki. All rights reserved.