From 2924ca67475afa3cc3c1a814b170b61803caeee9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 25 Jun 2006 18:29:49 +0000 Subject: Tweak dynahash.c to avoid wasting memory space in non-shared hash tables. palloc() will normally round allocation requests up to the next power of 2, so make dynahash choose allocation sizes that are as close to a power of 2 as possible. Back-patch to 8.1 --- the problem exists further back, but a much larger patch would be needed and it doesn't seem worth taking any risks. --- src/include/utils/hsearch.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/include') diff --git a/src/include/utils/hsearch.h b/src/include/utils/hsearch.h index 97bab5b85b1..a89be514d90 100644 --- a/src/include/utils/hsearch.h +++ b/src/include/utils/hsearch.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/hsearch.h,v 1.42 2006/03/05 15:59:07 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/hsearch.h,v 1.43 2006/06/25 18:29:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -156,8 +156,6 @@ typedef struct HASHCTL /* max_dsize value to indicate expansible directory */ #define NO_MAX_DSIZE (-1) -/* max number of hash elements allocated at once */ -#define HASHELEMENT_ALLOC_MAX (32) /* hash_search operations */ typedef enum -- cgit v1.2.3