Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!samsung!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.soft-sys.andrew Subject: New "malloc" doesn't get machine type from Message-ID: <2659@auspex.auspex.com> Date: 22 Nov 89 21:10:29 GMT Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 40 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 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 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 /* 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