Re: [HACKERS] questionable code in heap_formtuple()] - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] questionable code in heap_formtuple()]
Date
Msg-id 199809041751.NAA10337@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] questionable code in heap_formtuple()  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] questionable code in heap_formtuple()]
List pgsql-hackers
> > around line 812 in access/common/heaptuple.c:
> >
> >     len = sizeof *tuple - sizeof tuple->t_bits;
> >
> > This seems questionable for me.


> > I think more acculate way to calculate the offset is:
> >
> >     len = (char *)&tuple->t_bits[0] - (char *)tuple;

OK, now I am more confused.  Doesn't this work:

    len = sizeof(HeapTupleData) - offsetof(HeapTupleData.t_bits);

while your solution is finding the size of the area before t_bits?

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Andreas Zeugswetter
Date:
Subject: AW: [HACKERS] Release 6.4
Next
From: Paul A Vixie
Date:
Subject: Re: [HACKERS] Re: hackers-digest V1 #954