Hi Tomas,

>
> Right. I'm still not convinced if this makes any difference, or whether
> this alignment was merely a consequence of using ShmemAlloc(). I don't
> want to make this harder to understand unnecessarily.
>

Yeah, it makes sense.


> Let's keep this simple - without additional alignment. I'll think about
> it a bit more, and maybe add it before commit.
>

OK.


>
>
> > I will improve the comment in the next version.
> >
>
> OK. Do we even need to pass nelem_alloc to hash_get_init_size? It's not
> really used except for this bit:
>
> +    if (init_size > nelem_alloc)
> +        element_alloc = false;
>
> Can't we determine before calling the function, to make it a bit less
> confusing?
>

Yes, we could determine whether the pre-allocated elements are zero before
calling the function, I have fixed it accordingly in the attached 0001
patch.
Now, there's no need to pass `nelem_alloc` as a parameter. Instead, I've
passed this information as a boolean variable-initial_elems. If it is
false,
no elements are pre-allocated.

Please find attached the v7-series, which incorporates your review patches
and addresses a few remaining comments.

Thank you,
Rahila Syed

Attachment: v7-0002-Replace-ShmemAlloc-calls-by-ShmemInitStruct.patch
Description: Binary data

Attachment: v7-0003-Add-cacheline-padding-between-heavily-accessed-array.patch
Description: Binary data

Attachment: v7-0001-Account-for-all-the-shared-memory-allocated-by-hash_.patch
Description: Binary data

Reply via email to