Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Ranier Vilela <ranier.vf@gmail.com>
From: Ranier Vilela <ranier.vf@gmail.com>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2022-05-14T21:46:53Z
Lists: pgsql-hackers
Attachments
- avoid_unecessary_memset_call.patch (application/octet-stream) patch
Hi hackers, At function load_relcache_init_file, there is an unnecessary function call, to initialize pgstat_info pointer to NULL. MemSet(&rel->pgstat_info, 0, sizeof(rel->pgstat_info)); I think that intention with use of MemSet was: MemSet(&rel->pgstat_info, 0, sizeof(*rel->pgstat_info)); Initialize with sizeof of Struct size, not with sizeof pointer size. But so it breaks. Attached a tiny patch. regards, Ranier Vilela
Commits
-
Replace many MemSet calls with struct initialization
- 9fd45870c143 16.0 landed
-
Change some unnecessary MemSet calls
- 258f48f858b0 16.0 landed
-
Avoid unnecessary MemSet call
- 8cd61d288adf 16.0 landed