Re: Interesting misbehavior of repalloc() - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Interesting misbehavior of repalloc()
Date
Msg-id 87bqdd231j.fsf@oxford.xeocode.com
Whole thread Raw
In response to Interesting misbehavior of repalloc()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Interesting misbehavior of repalloc()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Perhaps we should just remove lines 934-982 of aset.c, and always handle
> small-chunk reallocs with the "brute force" case.  Can anyone see a way
> to salvage something from the "realloc-in-place" idea?
>
> One thought that comes to mind is to try to make AllocSetFree recognize
> when it's pfree'ing the last chunk in a memory block, and to handle that
> by decrementing the freeptr instead of putting the chunk into any
> freelist.  

We could also only do the realloc-in-place only if there isn't a 4k chunk in
the 4k freelist. I'm imagining that usually there wouldn't be.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Interesting misbehavior of repalloc()
Next
From: "April Lorenzen"
Date:
Subject: proper way to fix information_schema.key_column_usage view