Save a few bytes per CatCTup. CatalogCacheCreateEntry() computed the space needed for a CatCTup as sizeof(CatCTup) + MAXIMUM_ALIGNOF. That's not our usual style, and it wastes memory by allocating more padding than necessary. On 64-bit machines sizeof(CatCTup) would be maxaligned already since it contains pointer fields, therefore this code is wasting 8 bytes compared to the more usual MAXALIGN(sizeof(CatCTup)).
While at it, we don't really need to do MemoryContextSwitchTo() when we're only allocating one block. Author: ChangAo Chen <[email protected]> Reviewed-by: Tom Lane <[email protected]> Discussion: https://postgr.es/m/[email protected] Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e5a77d876dbb6168e3013d32198794c535f1627d Modified Files -------------- src/backend/utils/cache/catcache.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
