Re: Idea: closing the loop for "pg_ctl reload"
От | Tom Lane |
---|---|
Тема | Re: Idea: closing the loop for "pg_ctl reload" |
Дата | |
Msg-id | 6225.1425318280@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Idea: closing the loop for "pg_ctl reload" (Jan de Visser <jan@de-visser.net>) |
Ответы |
Re: Idea: closing the loop for "pg_ctl reload"
|
Список | pgsql-hackers |
Jan de Visser <jan@de-visser.net> writes: > On March 2, 2015 09:50:49 AM Tom Lane wrote: >> However, you could and should use pg_malloc0, which takes care of that >> for you... > I am (using pg_malloc, that is). So, just to be sure: pg_malloc memsets the > block to 0, right? No, it doesn't, but pg_malloc0 does. Consult the code if you're confused: src/common/fe_memutils.c > My question was more along the lines if memsetting to 0 to ensure that pointer > fields are NULL and int/long fields are 0. Yes, we do assume that widely, and so does a heck of a lot of other code. In principle the C standard doesn't require that a NULL pointer be all-zero-bits, only that casting "0" to a pointer yield a NULL pointer. But certainly there are no modern implementations that don't represent NULL as 0. Anybody who tried to do it differently would soon find that hardly any real-world C code would run on their platform. regards, tom lane
В списке pgsql-hackers по дате отправления: