From 39c94bb5cdd5d346765fbb3143e3024811dca09d Mon Sep 17 00:00:00 2001 From: ChangAo Chen Date: Wed, 11 Mar 2026 11:20:45 +0800 Subject: [PATCH v1] Save a few bytes per CatCTup --- src/backend/utils/cache/catcache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index 519089322f4..72ea4d038c9 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -2223,13 +2223,13 @@ CatalogCacheCreateEntry(CatCache *cache, HeapTuple ntp, Datum *arguments, /* Allocate memory for CatCTup and the cached tuple in one go */ oldcxt = MemoryContextSwitchTo(CacheMemoryContext); - ct = (CatCTup *) palloc(sizeof(CatCTup) + - MAXIMUM_ALIGNOF + dtp->t_len); + ct = (CatCTup *) palloc(MAXALIGN(sizeof(CatCTup)) + + dtp->t_len); ct->tuple.t_len = dtp->t_len; ct->tuple.t_self = dtp->t_self; ct->tuple.t_tableOid = dtp->t_tableOid; ct->tuple.t_data = (HeapTupleHeader) - MAXALIGN(((char *) ct) + sizeof(CatCTup)); + (((char *) ct) + MAXALIGN(sizeof(CatCTup))); /* copy tuple contents */ memcpy((char *) ct->tuple.t_data, (const char *) dtp->t_data, -- 2.34.1