From: Tom Lane Date: Sun, 25 Mar 2001 22:40:58 +0000 (+0000) Subject: Improve comments for xlog item size #defines. X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=f9702a9068715c89da42a1a77156ba068a05b5c7;p=users%2Fbernd%2Fpostgres.git Improve comments for xlog item size #defines. --- diff --git a/src/include/access/htup.h b/src/include/access/htup.h index a2125e469e..f19f7a9541 100644 --- a/src/include/access/htup.h +++ b/src/include/access/htup.h @@ -83,6 +83,11 @@ typedef HeapTupleHeaderData *HeapTupleHeader; /* * All what we need to find changed tuple (18 bytes) + * + * NB: on most machines, sizeof(xl_heaptid) will include some trailing pad + * bytes for alignment. We don't want to store the pad space in the XLOG, + * so use SizeOfHeapTid for space calculations. Similar comments apply for + * the other xl_FOO structs. */ typedef struct xl_heaptid { @@ -90,13 +95,15 @@ typedef struct xl_heaptid ItemPointerData tid; /* changed tuple id */ } xl_heaptid; +#define SizeOfHeapTid (offsetof(xl_heaptid, tid) + SizeOfIptrData) + /* This is what we need to know about delete */ typedef struct xl_heap_delete { xl_heaptid target; /* deleted tuple id */ } xl_heap_delete; -#define SizeOfHeapDelete (offsetof(xl_heaptid, tid) + SizeOfIptrData) +#define SizeOfHeapDelete (offsetof(xl_heap_delete, target) + SizeOfHeapTid) typedef struct xl_heap_header { @@ -115,14 +122,14 @@ typedef struct xl_heap_insert /* xl_heap_header & TUPLE DATA FOLLOWS AT END OF STRUCT */ } xl_heap_insert; -#define SizeOfHeapInsert (offsetof(xl_heaptid, tid) + SizeOfIptrData) +#define SizeOfHeapInsert (offsetof(xl_heap_insert, target) + SizeOfHeapTid) /* This is what we need to know about update|move */ typedef struct xl_heap_update { xl_heaptid target; /* deleted tuple id */ ItemPointerData newtid; /* new inserted tuple id */ - /* NEW TUPLE xl_heap_header (XMIN & XMAX FOR MOVE OP) */ + /* NEW TUPLE xl_heap_header (PLUS xmax & xmin IF MOVE OP) */ /* and TUPLE DATA FOLLOWS AT END OF STRUCT */ } xl_heap_update;