Re: Which MemoryContext?

From: "Gevik Babakhani" <pgdev(at)xs4all(dot)nl>
To: "'Alvaro Herrera'" <alvherre(at)commandprompt(dot)com>
Cc: "'Heikki Linnakangas'" <heikki(at)enterprisedb(dot)com>, "'pgsql-hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Which MemoryContext?
Date: 2008-02-21 08:04:56
Message-ID: 004801c87460$7358eff0$0a01a8c0@gevmus
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> All local memory is safe to handle that way.
In my case I am reallocating memory for a global variable between
transactions. I wanted to make sure I don't leave allocated memory behind.

> The problem only arises when you have memory to release _earlier_ than
that.
First I was looking for a way to free my allocated memory before exit. I
found the proc_exit hook mechanism but I am not sure where to setup this
hook.

Given allocating memory in TopMemoryContext is the same as malloc, then I'll
just leave my allocated memory to be freed automatically when exit.

Thank you :)

Regards,
Gevik

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-02-21 09:11:38 Re: VARATT_EXTERNAL_GET_POINTER is not quite there yet
Previous Message Peter Childs 2008-02-21 07:38:01 Re: Permanent settings