> int counts[1]; /* variable-length array of counts, xinfo flags define > length of array and meaning of counts */
Damn, that's much cleaner than what I did. I don't know why I stuck with the idea that it had to be: int array int array ... instead of: int int ... array array ... which makes much more sense. > Then, I'd make macros like this: > > #define XactCommitNumberOfDroppedRelFileNodes(xlrec) \ > ((xlref->xinfo & XACT_COMMIT_DROPPED_RELFILENODES) ? xlrec->counts[0] : 0) > #define XactCommitNumberOfCommittedSubXids(xlrec) \ > ((xlref->xinfo & XACT_COMMITED_SUBXDIDS) ? > xlrec->counts[(xlrec->xinfo & XACT_COMMIT_DROPPED_RELFILENODES) ? 1 : > 0] : 0) > ...etc... ehm I don't know if macros would be enough; that's ok for the first 2, then I think it would become a mess... Maybe I'll use a simple function that gets all "ints" at once. > ...and a similar set of macros that will return a pointer to the > beginning of the corresponding array, if it's present. I'd lay out > the record like this: > > - main record > - array of counts (might be zero-length) > - array of dropped relfilnodes (if any) > - array of committed subxids (if any) > - array of sinval messages (if any) ok > Also, it's important not to confuse xact completion with xact commit, > as I think some of your naming does. Completion could perhaps be > thought to include abort. mmh... I don't know if I got it... but I'll give a look, and ask questions... Thank you very much for the help Leonardo -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers