Re: A couple of cosmetic changes around shared memory code

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A couple of cosmetic changes around shared memory code
Date: 2016-05-16 19:56:02
Message-ID: CAB7nPqQzMxmsG_7AOXpT6EVA7C-tOPFQA9_9myakFGj2jmOnuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 17, 2016 at 4:40 AM, Piotr Stefaniak
<postgres(at)piotr-stefaniak(dot)me> wrote:
> while investigating the shm_mq code and its testing module I made some
> cosmetic improvements there. You can see them in the attached diff file.

- toc_bytes = offsetof(shm_toc, toc_entry) +nentry * sizeof(shm_toc_entry)
+ toc_bytes = offsetof(shm_toc, toc_entry) + nentry * sizeof(shm_toc_entry)
+ allocated_bytes;
I don't recall the exact reason, but this is intentional style
(memories from a patchwork with Tom). See for example geo_ops.c or
pl_funcs.c. Though it is true that things are not completely
consistent in the code with offset.

- seg = dsm_create(shm_toc_estimate(&e), 0);
+ seg = dsm_create(segsize, 0);
Yep.

- proc_exit(1);
+ proc_exit(0);
Agreed here. I don't see why this should not exit with 0 if there have
not been any errors.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-05-16 21:01:29 Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Re: [HACKERS] Windows service is not starting so there’s message in log: FATAL: "could not create shared memory segment “Global/PostgreSQL.851401618”: Permission denied”
Previous Message Piotr Stefaniak 2016-05-16 19:40:28 A couple of cosmetic changes around shared memory code