pg_malloc0() instead of pg_malloc()+memset() - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject pg_malloc0() instead of pg_malloc()+memset()
Date
Msg-id vN0OodBPkKs7g2Z1uyk3CUEmhdtspHgYCImhlmSxv1Xn6nY1ZnaaGHL8EWUIQ-NEv36tyc4G5-uA3UXUF2l4sFXtK_EQgLN1hcgunlFVKhA=@yesql.se
Whole thread Raw
Responses Re: pg_malloc0() instead of pg_malloc()+memset()
List 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

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_basebackup ignores the existing data directory permissions
Next
From: Heikki Linnakangas
Date:
Subject: Re: GiST VACUUM