Commit a49436d7 authored by Tom Lane's avatar Tom Lane

Pursuant to a pghackers discussion back around 11-Jul-00, get rid of aset.c's

not-very-good handling of mid-size allocation requests.  Do everything via
either the "small" case (chunk size rounded up to power of 2) or the "large"
case (pass it straight off to malloc()).  Increase the number of freelists
a little to set the breakpoint between these behaviors at 8K.
parent eb743d0f
This diff is collapsed.
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: memnodes.h,v 1.18 2000/07/11 14:30:34 momjian Exp $
* $Id: memnodes.h,v 1.19 2000/12/01 18:14:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -62,27 +62,6 @@ typedef struct MemoryContextData
/* utils/palloc.h contains typedef struct MemoryContextData *MemoryContext */
/*
* AllocSetContext is our standard implementation of MemoryContext.
*/
typedef struct AllocBlockData *AllocBlock; /* internal to aset.c */
typedef struct AllocChunkData *AllocChunk;
typedef struct AllocSetContext
{
MemoryContextData header; /* Standard memory-context fields */
/* Info about storage allocated in this context: */
AllocBlock blocks; /* head of list of blocks in this set */
#define ALLOCSET_NUM_FREELISTS 8
AllocChunk freelist[ALLOCSET_NUM_FREELISTS]; /* free chunk lists */
/* Allocation parameters for this context: */
Size initBlockSize; /* initial block size */
Size maxBlockSize; /* maximum block size */
AllocBlock keeper; /* if not NULL, keep this block
* over resets */
} AllocSetContext;
/*
* MemoryContextIsValid
* True iff memory context is valid.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment