summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/utils/activity/pgstat.c5
-rw-r--r--src/backend/utils/activity/pgstat_shmem.c10
2 files changed, 3 insertions, 12 deletions
diff --git a/src/backend/utils/activity/pgstat.c b/src/backend/utils/activity/pgstat.c
index f8e91484e36..73c2ced3f4e 100644
--- a/src/backend/utils/activity/pgstat.c
+++ b/src/backend/utils/activity/pgstat.c
@@ -932,7 +932,7 @@ pgstat_clear_snapshot(void)
void *
pgstat_fetch_entry(PgStat_Kind kind, Oid dboid, uint64 objid)
{
- PgStat_HashKey key;
+ PgStat_HashKey key = {0};
PgStat_EntryRef *entry_ref;
void *stats_data;
const PgStat_KindInfo *kind_info = pgstat_get_kind_info(kind);
@@ -943,9 +943,6 @@ pgstat_fetch_entry(PgStat_Kind kind, Oid dboid, uint64 objid)
pgstat_prep_snapshot();
- /* clear padding */
- memset(&key, 0, sizeof(struct PgStat_HashKey));
-
key.kind = kind;
key.dboid = dboid;
key.objid = objid;
diff --git a/src/backend/utils/activity/pgstat_shmem.c b/src/backend/utils/activity/pgstat_shmem.c
index 9dc3212f7dd..ca36fd247f6 100644
--- a/src/backend/utils/activity/pgstat_shmem.c
+++ b/src/backend/utils/activity/pgstat_shmem.c
@@ -456,14 +456,11 @@ PgStat_EntryRef *
pgstat_get_entry_ref(PgStat_Kind kind, Oid dboid, uint64 objid, bool create,
bool *created_entry)
{
- PgStat_HashKey key;
+ PgStat_HashKey key = {0};
PgStatShared_HashEntry *shhashent;
PgStatShared_Common *shheader = NULL;
PgStat_EntryRef *entry_ref;
- /* clear padding */
- memset(&key, 0, sizeof(struct PgStat_HashKey));
-
key.kind = kind;
key.dboid = dboid;
key.objid = objid;
@@ -988,13 +985,10 @@ pgstat_drop_database_and_contents(Oid dboid)
bool
pgstat_drop_entry(PgStat_Kind kind, Oid dboid, uint64 objid)
{
- PgStat_HashKey key;
+ PgStat_HashKey key = {0};
PgStatShared_HashEntry *shent;
bool freed = true;
- /* clear padding */
- memset(&key, 0, sizeof(struct PgStat_HashKey));
-
key.kind = kind;
key.dboid = dboid;
key.objid = objid;