Re: change palloc to malloc

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Nguyen Hai <nguyen_hai91(at)yahoo(dot)com>, List pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: change palloc to malloc
Date: 2005-03-17 09:56:28
Message-ID: 1111053388.4169.247.camel@petra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2005-03-15 at 18:29 -0500, Bruce Momjian wrote:
> Nguyen Hai wrote:
> > Hi,
> >
> > Is it possible to convert palloc back to malloc?
> > If so, what should I do to make the change?
>
> You can, but palloc is automatically freed at the end of a query, while
> malloc has to be freed in the code. Why do you want to make the
> switch?

Right. And it's definitely faster use palloc() than malloc(). I think
the current code is really based on memory contexts and I'm sure that
(strange:-) s/palloc/malloc/ is not enough.

Karel
--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak 2005-03-17 10:07:19 Re: invalidating cached plans
Previous Message Simon Riggs 2005-03-17 09:13:50 Re: read-only database