Re: [HACKERS] patch for memory overrun on Linux(i386) - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] patch for memory overrun on Linux(i386)
Date
Msg-id 199803220521.AAA05976@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] patch for memory overrun on Linux(i386)  (Marc Howard Zuckman <marc@fallon.classyad.com>)
Responses Re: [HACKERS] patch for memory overrun on Linux(i386)  (Massimo Dal Zotto <dz@cs.unitn.it>)
List 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@candle.pha.pa.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)

pgsql-hackers by date:

Previous
From: Marc Howard Zuckman
Date:
Subject: Re: [HACKERS] patch for memory overrun on Linux(i386)
Next
From: Bruce Momjian
Date:
Subject: Re: [QUESTIONS] How do I build libpgtcl?