Andrew Dunstan wrote:
> >   The proc.c cases were using MemSet, which was checking if the
> > int* as aligned for int* access.  In fact, we could change MemSet to
> > always take a void *, and do the int* casting when we access it after
> > testing for alignment.
> >
> 
> Since MemSet is generic, that is probably a good idea.

I have applied the following patch to add an additional void* cast to
MemSet, and added a comment that this was safe because alignment is
checked below --- patch attached.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/include/c.h
===================================================================
RCS file: /cvsroot/pgsql-server/src/include/c.h,v
retrieving revision 1.153
diff -c -c -r1.153 c.h
*** src/include/c.h     21 Sep 2003 17:57:21 -0000      1.153
--- src/include/c.h     11 Oct 2003 19:51:09 -0000
***************
*** 604,610 ****
  #define MemSet(start, val, len) \
        do \
        { \
!               int32 * _start = (int32 *) (start); \
                int             _val = (val); \
                Size    _len = (len); \
  \
--- 604,611 ----
  #define MemSet(start, val, len) \
        do \
        { \
!           /* (void *) used because we check for alignment below */ \
!               int32 * _start = (int32 *) (void *) (start); \
                int             _val = (val); \
                Size    _len = (len); \
  \
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to