Re: Plan for compressed varlena headers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Plan for compressed varlena headers
Date
Msg-id 9771.1171502028@sss.pgh.pa.us
Whole thread Raw
In response to Re: Plan for compressed varlena headers  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>> Plus you can't do it without multiple evaluation of the macro argument,

> I don't see any way to do VARSIZE without multiply evaluating its argument.

Some variant of
#define VARSIZE(x)    (ntohl((x)->vl_len) & 0x3fffffff)#define VARSIZE(x)    ((x)->vl_len >> 2)

The 1-or-4-byte version is a lot harder, but also will be used in a lot
fewer places, all of which will get looked at when it gets installed.
I'm prepared to put up with multiple eval for that.  I *don't* want to
assume that existing code can tolerate multiple eval in a macro that has
existed forever and never did it before.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Plan for compressed varlena headers
Next
From: elein
Date:
Subject: Re: Variable length varlena headers redux