Re: Inefficient handling of LO-restore + Patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Mario Weilguni <mario(dot)weilguni(at)icomedias(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Inefficient handling of LO-restore + Patch
Date: 2002-04-25 02:59:41
Message-ID: 200204250259.g3P2xfw12908@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mario Weilguni wrote:
> Am Mittwoch, 24. April 2002 16:03 schrieb Bruce Momjian:
> > OK, I have applied the following patch to fix these warnings. However,
> > I need Mario to confirm these are the right changes. Thanks.
>
> I've checked it and works fine, but the memcpy() prototype says it should be
> void pointers. Will this give errors with non-gcc compilers?

No, it is fine. Anything can be cast _to_ a void pointer. You just
can't do arithmetic on them.

Are you sure you want to use 'void *' in your code. Looking at the
backend large object code, I see char *:

extern int inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes);
extern int inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes);

I guess my point is that these are just streams of bytes, _not_ really
streams of items of unknown length. We know the length, and the length
is char. This may simplify the code.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2002-04-25 03:00:28 Re: Vote on SET in aborted transaction
Previous Message Tom Lane 2002-04-25 02:55:35 Re: unknownin/out patch