Is the member name of hashctl inappropriate?

Поиск
Список
Период
Сортировка
От ywgrit
Тема Is the member name of hashctl inappropriate?
Дата
Msg-id CAPt2h2acO1pmKO5aoVtkZa74vgFuXP2aEn8vigkr1GDUpwLWgA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Is the member name of hashctl inappropriate?
Список pgsql-hackers

The definition of hashctl is shown below

typedef struct HASHCTL
{
      long           num_partitions; /* # partitions (must be power of 2) */
      long           ssize;                 /* segment size */
      long           dsize;                 /* (initial) directory size */
      long           max_dsize;             /* limit to dsize if dir size is limited */
      long           ffactor;               /* fill factor */
      Size           keysize;               /* hash key length in bytes */
      Size           entrysize;             /* total user element size in bytes */
      HashValueFunc hash;                     /* hash function */
      HashCompareFunc match;         /* key comparison function */
      HashCopyFunc keycopy;           /* key copying function */
      HashAllocFunc alloc;           /* memory allocator */
      MemoryContext hcxt;                     /* memory context to use for allocations */
      HASHHDR   *hctl;                       /* location of header in shared mem */
} HASHCTL;


/*
* Key copying functions must have this signature. The return value is not
* used. (The definition is set up to allow memcpy() and strlcpy() to be
* used directly.)
*/
typedef void *(*HashCopyFunc) (void *dest, const void *src, Size keysize);

According to the description, the keycopy function only copies the key, but in reality it copies the entire entry, i.e., the key and the value, is the name wrong? This may make the developer pass in an inappropriate keycopy parameter when creating the htab.

Thanks

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Erik Wienhold
Дата:
Сообщение: Re: JSON Path and GIN Questions
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)