Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org>,PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Date: 2002-05-06 10:59:58
Message-ID: 20020506105958.GD17805@feivel.credativ.de (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces
On Mon, May 06, 2002 at 09:37:18AM +0200, Christof Petig wrote:
> Never, never mix these two! ECPGfree_auto_mem will free even memory 
> which has already been free'd by the user, perhaps we should get rid of 

That's why I discourage the usage of ECPGfree_auto_mem by the user.
There is only one reason why the symbol is not static and that is that
it is used by another module in libecpg.

I never thought about this as an end user routine, it's just meant as a
clean up method in case of an error during statement execution.

BTW Christof, ECPGfree_auto_mem is used by testdynalloc.pgc. Maybe we
should change that.

> this method (any allocated memory regions are stored in a list, if you 
> never call ECPGfree_auto_mem, this list grows and grows).

That is not true. Before a statement is executed libecpg calls
ECPGclear_auto_mem which just frees ecpg's own structure but not the
memory used for data.

Michael
-- 
Michael Meskes
Michael(at)Fam-Meskes(dot)De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

In response to

pgsql-hackers by date

Next:From: Michael MeskesDate: 2002-05-06 11:00:51
Subject: Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Previous:From: Hannu KrosingDate: 2002-05-06 10:48:32
Subject: Re: Native Windows, Apache Portable Runtime

pgsql-interfaces by date

Next:From: Michael MeskesDate: 2002-05-06 11:00:51
Subject: Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Previous:From: Lee KindnessDate: 2002-05-06 10:24:36
Subject: Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group