@@ -240,7 +240,7 @@ InitShmemIndex(void)
240240hash_flags = HASH_ELEM ;
241241
242242ShmemIndex = ShmemInitHash ("ShmemIndex" ,
243- SHMEM_INDEX_SIZE ,SHMEM_INDEX_SIZE ,
243+ SHMEM_INDEX_SIZE ,
244244& info ,hash_flags );
245245}
246246
@@ -258,17 +258,12 @@ InitShmemIndex(void)
258258 * exceeded substantially (since it's used to compute directory size and
259259 * the hash table buckets will get overfull).
260260 *
261- * init_size is the number of hashtable entries to preallocate. For a table
262- * whose maximum size is certain, this should be equal to max_size; that
263- * ensures that no run-time out-of-shared-memory failures can occur.
264- *
265261 * Note: before Postgres 9.0, this function returned NULL for some failure
266262 * cases. Now, it always throws error instead, so callers need not check
267263 * for NULL.
268264 */
269265HTAB *
270266ShmemInitHash (const char * name ,/* table string name for shmem index */
271- long init_size ,/* initial table size */
272267long max_size ,/* max size of the table */
273268HASHCTL * infoP ,/* info about key and bucket size */
274269int hash_flags )/* info about infoP */
@@ -302,7 +297,7 @@ ShmemInitHash(const char *name, /* table string name for shmem index */
302297/* Pass location of hashtable header to hash_create */
303298infoP -> hctl = (HASHHDR * )location ;
304299
305- return hash_create (name ,init_size ,infoP ,hash_flags );
300+ return hash_create (name ,max_size ,infoP ,hash_flags );
306301}
307302
308303/*