mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
simplehash: Additional tweaks to make specifying an allocator work.
Even if we don't emit definitions for SH_ALLOCATE and SH_FREE, we still need prototypes. The user can't define them before including simplehash.h because SH_TYPE isn't available yet. For the allocator to be able to access private_data, it needs to become an argument to SH_CREATE. Previously we relied on callers to set that after returning from SH_CREATE, but SH_CREATE calls SH_ALLOCATE before returning. Dilip Kumar, reviewed by me.
This commit is contained in:
@ -330,8 +330,7 @@ BuildTupleHashTable(int numCols, AttrNumber *keyColIdx,
|
||||
else
|
||||
hashtable->hash_iv = 0;
|
||||
|
||||
hashtable->hashtab = tuplehash_create(tablecxt, nbuckets);
|
||||
hashtable->hashtab->private_data = hashtable;
|
||||
hashtable->hashtab = tuplehash_create(tablecxt, nbuckets, hashtable);
|
||||
|
||||
return hashtable;
|
||||
}
|
||||
|
Reference in New Issue
Block a user