Обсуждение: palloc0

Поиск
Список
Период
Сортировка

palloc0

От
mohsen soodkhah mohammadi
Дата:
<div dir="ltr">if I don't dalloc parameters that allocated with palloc0 then will free the allocated memory at the end
oftransaction?<br /></div> 

Re: palloc0

От
Atri Sharma
Дата:

Sent from my iPad

> On 30-Nov-2013, at 14:30, mohsen soodkhah mohammadi <mohsensoodkhah@gmail.com> wrote:
>
> if I don't dalloc parameters that allocated with palloc0 then will free the allocated memory at the end of
transaction?

Yes, palloc allocates memory in contexts, and the memory allocated in these contexts by palloc are freed at the
deletionof the context. 

Regards,

Atri


Re: palloc0

От
Andrew Dunstan
Дата:
On 11/30/2013 04:00 AM, mohsen soodkhah mohammadi wrote:
> if I don't dalloc parameters that allocated with palloc0 then will 
> free the allocated memory at the end of transaction?


Please read src/backend/utils/mmgr/README

cheers

andrew



Re: palloc0

От
Michael Paquier
Дата:
On Sat, Nov 30, 2013 at 11:41 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
> Please read src/backend/utils/mmgr/README
And that as well directly in the docs:
http://www.postgresql.org/docs/devel/static/xfunc-c.html#AEN53984
"The memory allocated by palloc will be freed automatically at the end
of each transaction, preventing memory leaks."
Regards,
-- 
Michael