Pavan Deolasee <pavan.deolasee@gmail.com> writes:
> BTW, on an unrelated note, I was looking at the way ShmemInitStruct()
> is used. It internally uses ShmemAlloc to allocate from shared memory.
> ShmemAlloc always MAXALIGN the requested size. But while calculating
> the total shared memory requirement, we don't always MAXALIGN
> individual structure sizes. One example is KnownAssignedXidsValid, but
> I am sure there are other places where the originally computed and the
> requested sizes could be different because of alignment.
> I wonder if we are just lucky not to hit shared memory size mismatch,
> may be because we round up to the block size at the end.
That sort of thing is down in the noise. One reason we throw in the
100KB slop is so we don't have to sweat details like that.
regards, tom lane