Question about coding of free space map - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Question about coding of free space map
Date
Msg-id 20140826.111323.42915740668569590.t-ishii@sraoss.co.jp
Whole thread Raw
Responses Re: Question about coding of free space map
List pgsql-hackers
While looking into backend/storage/freespace/freespace.c, I noticed
that struct FSMAddress is passed to functions by value, rather than
reference. I thought our code practice is defining pointer to a struct
data and using the pointer for parameter passing etc.

typedef struct RelationData *Relation;

IMO freespace.c is better to follow the practice.

Maybe this has been allowed because:

typedef struct
{int            level;            /* level */int            logpageno;        /* page number within the level */
} FSMAddress;

the struct size is 4+4=8 byte, which is same as 64 bit pointer. Still
I think it's better to use pointer to the struct because someday we
may want to add new member to the struct.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: postgresql latency & bgwriter not doing its job
Next
From: Bruce Momjian
Date:
Subject: Re: Hardening pg_upgrade