Re: C Function Memory Management - Mailing list pgsql-general

From Tom Lane
Subject Re: C Function Memory Management
Date
Msg-id 8510.1355326141@sss.pgh.pa.us
Whole thread Raw
In response to Re: C Function Memory Management  (Martin French <Martin.French@romaxtech.com>)
Responses Re: C Function Memory Management  (Martin French <Martin.French@romaxtech.com>)
List pgsql-general
Martin French <Martin.French@romaxtech.com> writes:
>> repalloc

> Maybe I should've looked a little harder for that one! Ha Ha!

> I assume it's an exact functional copy of realloc, and see where I get
> with it!

One thing to know about it is that repalloc re-sizes the given chunk
while keeping it in the same memory context it was originally allocated
in (ie, CurrentMemoryContext doesn't matter).  This may not matter much
if you're only dealing with allocations that just live as long as the
current function call --- but if you're trying to preserve data across
calls, it's critical to know.

            regards, tom lane


pgsql-general by date:

Previous
From: wd
Date:
Subject: Re: Looking for cooperators
Next
From: Martin French
Date:
Subject: Re: C Function Memory Management