Switch some palloc/memset calls to palloc0
Michael Paquier <michael@paquier.xyz>
Switch some palloc/memset calls to palloc0 Some code paths have been doing some allocations followed by an immediate memset() to initialize the allocated area with zeros, this is a bit overkill as there are already interfaces to do both things in one call. Author: Daniel Gustafsson Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/vN0OodBPkKs7g2Z1uyk3CUEmhdtspHgYCImhlmSxv1Xn6nY1ZnaaGHL8EWUIQ-NEv36tyc4G5-uA3UXUF2l4sFXtK_EQgLN1hcgunlFVKhA=@yesql.se
Files
| Path | Change | +/− |
|---|---|---|
| contrib/tablefunc/tablefunc.c | modified | +2 −5 |
| src/backend/access/gist/gist.c | modified | +1 −2 |
| src/bin/pgbench/pgbench.c | modified | +1 −2 |
| src/bin/pg_dump/pg_backup_archiver.c | modified | +1 −2 |
| src/bin/pg_dump/pg_dump_sort.c | modified | +1 −2 |
Discussion
- pg_malloc0() instead of pg_malloc()+memset() 4 messages · 2019-03-25 → 2019-03-27