On Thu, Apr 16, 2026 at 2:17 AM Chao Li <[email protected]> wrote:
> I checked the code of dsm_create(), and I did not see anything showing that 
> the created shared-memory segment is zeroed.
>
> This is actually just an eyeball finding. From my tracing on my MacBook, 
> after shared = (DecodingWorkerShared *) dsm_segment_address(seg);, the memory 
> always seemed to be zeroed, so I may have missed something. But given that 
> the code explicitly initializes several other fields, it seems better not to 
> rely on that implicitly.

For the record, that depends on whether you get a newly allocated
shared memory segment from the operating system, or recycled shared
memory reserved at startup with the min_dynamic_shared_memory setting
(as shown in Alexander Lakhin's reproducer).


Reply via email to