aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2019-03-27 12:02:50 +0900
committerMichael Paquier <michael@paquier.xyz>2019-03-27 12:02:50 +0900
commit1983af8e899389187026cb34c1ca9d89ea986120 (patch)
tree9bdef33ce2dcffd83fe159032272cd94b0aa6a46 /src/backend/access/gist/gist.c
parent5bde1651bbba9984dc32bbeb68b329cfd3f92767 (diff)
downloadpostgresql-1983af8e899389187026cb34c1ca9d89ea986120.tar.gz
postgresql-1983af8e899389187026cb34c1ca9d89ea986120.zip
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
Diffstat (limited to 'src/backend/access/gist/gist.c')
-rw-r--r--src/backend/access/gist/gist.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index a746e911f37..2fddb23496d 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -43,8 +43,7 @@ static void gistprunepage(Relation rel, Page page, Buffer buffer,
#define ROTATEDIST(d) do { \
- SplitedPageLayout *tmp=(SplitedPageLayout*)palloc(sizeof(SplitedPageLayout)); \
- memset(tmp,0,sizeof(SplitedPageLayout)); \
+ SplitedPageLayout *tmp=(SplitedPageLayout*)palloc0(sizeof(SplitedPageLayout)); \
tmp->block.blkno = InvalidBlockNumber; \
tmp->buffer = InvalidBuffer; \
tmp->next = (d); \