simplehash: Additional tweaks to make specifying an allocator work.

Robert Haas <rhaas@postgresql.org>

Commit: 72257f95781af97108fa9a9e7224ec81a90e7693
Author: Robert Haas <rhaas@postgresql.org>
Date: 2017-02-09T19:59:57Z
Releases: 10.0
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.

Files