Re: [PATCH] Make gram.y use palloc/pfree for memory management

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Make gram.y use palloc/pfree for memory management
Дата
Msg-id 5621.1220388193@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Make gram.y use palloc/pfree for memory management  ("Marko Kreen" <markokr@gmail.com>)
Список pgsql-hackers
"Marko Kreen" <markokr@gmail.com> writes:
> On 9/1/08, Marko Kreen <markokr@gmail.com> wrote:
>> First a correction, overriding malloc/free seems dangerous they
>> seems to leak out, so correct would be to use YYMALLOC/YYFREE.
>> This leaves 1.875 potentially leaking, but danger seems small.

> Here is the safer patch.  As the chance for the leak is rare,
> leaving 1.875 vulnerable should not be problem.

Actually, 1.875 appears to default to using alloca() when available,
so the issue doesn't even arise if you're building with gcc.  (This
is probably why I'd never noticed a problem in this area.)

I thought that we might have an issue with flex as well, but so far as
I can tell there's no real problem given our current usage style for
the lexers.

Applied to all the backend .l files ...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: make dist does not include man.tar.gz and postgres.tar.gz
Следующее
От: Tom Lane
Дата:
Сообщение: Re: make dist does not include man.tar.gz and postgres.tar.gz