1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-08 00:47:37 +03:00

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.
This commit is contained in:
Tom Lane
2000-12-01 18:14:29 +00:00
parent eb743d0f98
commit a49436d7e9
2 changed files with 205 additions and 189 deletions

View File

@@ -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.