Re: Which MemoryContext?

From: "Gevik Babakhani" <pgdev(at)xs4all(dot)nl>
To: "'Heikki Linnakangas'" <heikki(at)enterprisedb(dot)com>
Cc: "'pgsql-hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Which MemoryContext?
Date: 2008-02-20 23:12:12
Message-ID: 001601c87416$06dc9100$0a01a8c0@gevmus
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> TopMemoryContext sounds right. Be careful not to leak there.

Thank you :)

I have allocated memory using: MemoryContextAlloc(TopMemoryContext,n *
sizeof(char*));
In pgsql/src/backend/utils/mmgr/README:142 is stated that memory allocated
using above should be freed manually, Is this correct? Or does the system
release everything allocated in TopMemoryContext automatically when exiting?

I looked around and found examples where memory allocated
using above is not freed! (datetime.c:3811, uhhh.. a bit confused here)

Any thoughts?

Regards,
Gevik.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aidan Van Dyk 2008-02-20 23:17:37 Re: Permanent settings
Previous Message Josh Berkus 2008-02-20 23:02:49 Re: Permanent settings