Skip site navigation (1) Skip section navigation (2)

Re: Something's been bugging me

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "PostgreSQL-development Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Something's been bugging me
Date: 2007-09-30 23:39:47
Message-ID: 7239.1191195587@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> Gregory Stark <stark(at)enterprisedb(dot)com> writes:
>>> Why do you cast arguments to memcmp to char* ?
>> 
>> Well, *I* haven't done it in a long time, 

> I'm referring to tuptoaster.c:488

Oh, I'm sorry, I thought you were talking about my hypothetical memcpy
example.

The casts in the memcmp call were because I was worried about some
compiler trying to optimize the memcmp into a word-wide operation
on the strength of the theory that struct varlena pointers must be
word-aligned.  Given the later discovery about the copying problem,
those casts may be unhelpful as far as gcc is concerned; but I'm still
inclined to leave them there in case they make a difference for some
other compiler.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Islam HegazyDate: 2007-10-01 00:12:08
Subject: adding operators
Previous:From: Gregory StarkDate: 2007-09-30 23:26:22
Subject: Re: Something's been bugging me

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group