On Sun, 15 Dec 2002 23:49:57 -0300, Alvaro Herrera
<[EMAIL PROTECTED]> wrote:
>PageGetMaxOffsetNumber (the upper bound) returns a consistent value
>that's far too high (4294967291, 0xFFFFFFFB)

Alvaro, maybe this comment from bufpage.h can shed some light on it?

/*
 * PageGetMaxOffsetNumber
 *  Returns the maximum offset number used by the given page.
 *  Since offset numbers are 1-based, this is also the number
 *  of items on the page.
 *
 *  NOTE: to ensure sane behavior if the page is not initialized
 *  (pd_lower == 0), cast the unsigned values to int before dividing.
 *  That way we get -1 or so, not a huge positive number...
 */

#define PageGetMaxOffsetNumber(page) \
  (((int) (((PageHeader) (page))->pd_lower - SizeOfPageHeaderData)) \
   / ((int) sizeof(ItemIdData)))

0xFFFFFFFB is -5.
With SizeOfPageHeaderData == 20 and sizeof(ItemIdData) == 4 you get
this result for pd_lower == 0.

Servus
 Manfred

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to