Why not align item size in dshash_table? - Mailing list pgsql-hackers

From Hao Zhang
Subject Why not align item size in dshash_table?
Date
Msg-id CALY6Dr9pm0KYOvEbQMA8DHSgjOc=eO-4WQkK=ehv=SiQkyAPZQ@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hi hackers,
I found that the entry size is not aligned with MAXALIGN, but dshash_table_item did that in dshash_table. IMHO, both entry size and dshash_table_item should be aligned with MAXALIGN.

static dshash_table_item *
insert_into_bucket(dshash_table *hash_table,
const void *key,
dsa_pointer *bucket)
{
dsa_pointer item_pointer;
dshash_table_item *item;

item_pointer = dsa_allocate(hash_table->area,
hash_table->params.entry_size +
MAXALIGN(sizeof(dshash_table_item)));
item = dsa_get_address(hash_table->area, item_pointer);
copy_key(hash_table, ENTRY_FROM_ITEM(item), key);
insert_item_into_bucket(hash_table, item_pointer, item, bucket);
return item;
}

With regards,
Hao Zhang

pgsql-hackers by date:

Previous
From: Ilia Evdokimov
Date:
Subject: Re: change regexp_substr first argument make tests more easier to understand.
Next
From: Ajay Pal
Date:
Subject: Re: SQL Property Graph Queries (SQL/PGQ)