Re: [HACKERS] patch for memory overrun on Linux(i386)

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: marc(at)fallon(dot)classyad(dot)com (Marc Howard Zuckman)
Cc: scrappy(at)hub(dot)org, mgittens(at)david(dot)gits(dot)nl, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] patch for memory overrun on Linux(i386)
Date: 1998-03-22 05:21:22
Message-ID: 199803220521.AAA05976@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> >From the linux man page:
> For calloc() and malloc(), the value returned is a pointer
> to the allocated memory, which is suitably aligned for any
> kind of variable, or NULL if the request fails.

OK, then why is electric fence telling him to make DOUBLEALIGN match
INTALIGN? You would think that if this change made sense, we would be
having some Linux problems, but we don't.

---------------------------------------------------------------------------

#if ! defined(sco)
#define DOUBLEALIGN(LEN)\
(((long)(LEN) + (sizeof (double) - 1)) & ~(sizeof (double) -1))

#define MAXALIGN(LEN)\
(((long)(LEN) + (sizeof (double) - 1)) & ~(sizeof (double) -1))
#else
#define DOUBLEALIGN(LEN) INTALIGN(LEN)
#define MAXALIGN(LEN) INTALIGN(LEN)
#endif

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-03-22 05:30:01 Re: [HACKERS] psql nested queries with 2000+ records
Previous Message Bruce Momjian 1998-03-22 05:16:51 Re: [QUESTIONS] How do I build libpgtcl?