Re: GIST code doesn't build on strict 64-bit machines

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: GIST code doesn't build on strict 64-bit machines
Дата
Msg-id 1682.1080577340@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: GIST code doesn't build on strict 64-bit machines  (Teodor Sigaev <teodor@sigaev.ru>)
Ответы Re: GIST code doesn't build on strict 64-bit machines  (Teodor Sigaev <teodor@sigaev.ru>)
Список pgsql-hackers
Teodor Sigaev <teodor@sigaev.ru> writes:
> I suggest to replace bytea by struct
> typedef struct {
>     int32    n; /* number of GISTENTRY */
>     GISTENTRY  vector[1];
> } GistEntryVector;

Yes, I was thinking the same thing.

> #define GEVHDRSZ    (MAXALIGN(sizeof(int32))
> so, allocation will be:
> evec = palloc( GEVHDRSZ + sizeof(GISTENTRY)*n );
> MAXALIGN guarantee that allocated memory will be no less than required (it may 
> be  greater for 4 bytes).

That would work, or you could use offsetof(GistEntryVector, vector[0]).
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Teodor Sigaev
Дата:
Сообщение: Re: GIST code doesn't build on strict 64-bit machines
Следующее
От: markw@osdl.org
Дата:
Сообщение: Re: PostgreSQL block size vs. LVM2 stripe width