On 5/15/08, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Marko Kreen" <markokr(at)gmail(dot)com> writes:
> > How about following patch? I have bison 2.3 and it seems not to do
> > global allocation, so it should be fine. There may be early exit
> > with elog(ERRROR) inside so I'd like to avoid malloc() itself.
>
> None of our other parsers fool with bison's memory allocation;
> why does yours need to?
Because that way I can be sure I understand their allocation behaviour.
Eg. how does src/backend/parser/gram.c not leak memory on syntax error?
I don't understand it.
But if I force them use palloc(), always, I can be sure memore is freed.
--
marko