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
Message-ID: vN0OodBPkKs7g2Z1uyk3CUEmhdtspHgYCImhlmSxv1Xn6nY1ZnaaGHL8EWUIQ-NEv36tyc4G5-uA3UXUF2l4sFXtK_EQgLN1hcgunlFVKhA=@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

Responses

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