pg_malloc0() instead of pg_malloc()+memset()

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: pg_malloc0() instead of pg_malloc()+memset()
Date: 2019-03-25 13:18:05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

When reading another codepath, I happened to notice a few codepaths where we do
pg_malloc() immediately followed by a memset( .. 0, ..), without there being a
justification (that I can see) for not using pg_malloc0() instead. The attached
patch changes to pg_malloc0(), and passes make check.

cheers ./daniel

Attachment Content-Type Size
pg_malloc0.patch application/octet-stream 2.3 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2019-03-25 13:20:39 Re: GiST VACUUM
Previous Message Robert Haas 2019-03-25 13:08:23 Re: pg_basebackup ignores the existing data directory permissions