Re: Plan for compressed varlena headers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "PostgreSQL Development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Plan for compressed varlena headers
Date: 2007-02-15 01:13:48
Message-ID: 9771.1171502028@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message elein 2007-02-15 01:31:31 Re: Variable length varlena headers redux
Previous Message Jeremy Drake 2007-02-15 00:49:32 Re: patch adding new regexp functions