Re: Idea: closing the loop for "pg_ctl reload" - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Idea: closing the loop for "pg_ctl reload"
Date
Msg-id 2054163505.1329546.1425329224614.JavaMail.yahoo@mail.yahoo.com
Whole thread Raw
In response to Re: Idea: closing the loop for "pg_ctl reload"  (Jan de Visser <jan@de-visser.net>)
List pgsql-hackers
Jan de Visser <jan@de-visser.net> wrote:
> 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?

I think you may have misread a zero character as an empty pair of
parentheses.  Tom pointed out that the pg_malloc() function gives
you uninitialized memory -- you cannot count on the contents.  He
further pointed out that if you need it to be initialized to '0'
bytes you should call the pg_malloc0() function rather than calling
the pg_malloc() function and running memset separately.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 32bit OID wrap around concerns
Next
From: Andres Freund
Date:
Subject: autogenerated column names + views are a dump hazard