Skip to content

Commit 4646a8f

Browse files
committed
Reduce the minimum allocable chunk size to 8 bytes (from 16). Now that
ListCells are only 8 bytes instead of 12 (on 4-byte-pointer machines anyway), it's worth maintaining a separate freelist for 8-byte objects. Remembering that alloc chunks carry 8 bytes of overhead, this should reduce the net storage requirement for a long List by about a third.
1 parent 0858ed2 commit 4646a8f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/utils/mmgr/aset.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/utils/mmgr/aset.c,v 1.54 2003/11/29 19:52:04 pgsql Exp $
14+
* $PostgreSQL: pgsql/src/backend/utils/mmgr/aset.c,v 1.55 2004/05/26 19:44:15 tgl Exp $
1515
*
1616
* NOTE:
1717
* This is a new (Feb. 05, 1999) implementation of the allocation set
@@ -85,16 +85,16 @@
8585
* CAUTION: ALLOC_MINBITS must be large enough so that
8686
* 1<<ALLOC_MINBITS is at least MAXALIGN,
8787
* or we may fail to align the smallest chunks adequately.
88-
* 16-byte alignment is enough on all currently known machines.
88+
* 8-byte alignment is enough on all currently known machines.
8989
*
9090
* With the current parameters, request sizes up to 8K are treated as chunks,
9191
* larger requests go into dedicated blocks. Change ALLOCSET_NUM_FREELISTS
9292
* to adjust the boundary point.
9393
*--------------------
9494
*/
9595

96-
#define ALLOC_MINBITS 4 /* smallest chunk size is 16 bytes */
97-
#define ALLOCSET_NUM_FREELISTS 10
96+
#define ALLOC_MINBITS 3 /* smallest chunk size is 8 bytes */
97+
#define ALLOCSET_NUM_FREELISTS 11
9898
#define ALLOC_CHUNK_LIMIT (1 << (ALLOCSET_NUM_FREELISTS-1+ALLOC_MINBITS))
9999
/* Size of largest chunk that we use a fixed size for */
100100

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy