[comp.soft-sys.andrew] New "malloc" doesn't get machine type from <system.h>

guy@auspex.auspex.com (Guy Harris) (11/23/89)

It turns out that the new Andrew "malloc", which is intended to align
blocks on 8-byte boundaries on machines such as SPARC that have data
types requiring 8-byte alignment, doesn't include <system.h> at the
right point to actually find out whether the machine is of a type that
requires this alignment.  Fixing that by adding an #include of
<system.h> points out another bug, namely a missing backslash in a
multi-line #define.

(Things are still dropping core, but I don't know what's causing it yet.)

*** imalloc.h.dist	Wed Nov 15 17:17:39 1989
--- imalloc.h	Wed Nov 22 11:55:39 1989
***************
*** 28,33 ****
--- 28,35 ----
  #ifndef _MALLOCITC_
  #define _MALLOCITC_
  
+ #include <system.h>	/* to define machine type */
+ 
  #define INT long
  /* structs need 8 byte alignment on SPARC */
  #ifdef sys_sun4_40
***************
*** 98,104 ****
  
  #if (SIZEOFCHARSTAR + 2*SIZEOFINT) % WORD
  #define PADHEADER   \
! 	int padding[(WORD-(SIZEOFCHARSTAR+2* SIZEOFINT)%WORD) 
  			/ SIZEOFINT];
  #else
  #define PADHEADER
--- 100,106 ----
  
  #if (SIZEOFCHARSTAR + 2*SIZEOFINT) % WORD
  #define PADHEADER   \
! 	int padding[(WORD-(SIZEOFCHARSTAR+2* SIZEOFINT)%WORD) \
  			/ SIZEOFINT];
  #else
  #define PADHEADER