Re: A couple of cosmetic changes around shared memory code

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: A couple of cosmetic changes around shared memory code
Дата
Msg-id CAB7nPqQzMxmsG_7AOXpT6EVA7C-tOPFQA9_9myakFGj2jmOnuA@mail.gmail.com
обсуждение исходный текст
Ответ на A couple of cosmetic changes around shared memory code  (Piotr Stefaniak <postgres@piotr-stefaniak.me>)
Ответы Re: A couple of cosmetic changes around shared memory code  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, May 17, 2016 at 4:40 AM, Piotr Stefaniak
<postgres@piotr-stefaniak.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Piotr Stefaniak
Дата:
Сообщение: A couple of cosmetic changes around shared memory code
Следующее
От: Michael Paquier
Дата:
Сообщение: 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”