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