This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [thockin@cobaltnet.com] libc/1206: thread stack is misaligned on mips


>>>>> Andreas Schwab writes:

AS> Andreas Jaeger <aj@arthur.rhein-neckar.de> writes:
AS> |> 1999-07-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
AS> | >
AS> |> 	* internals.h: Align _pthread_descr_struct to 32
AS> |> 	bytes.  We need to align it to 16 bytes for MIPS64 and 8 bytes
AS> |> 	for MIPS, 32 bytes might give better cache utilization.
AS> |> 	Reported by Tim Hockin <thockin@cobaltnet.com>, closes PR
AS> |> 	libc/1206.

AS> Just a note: such comments (I'm refering to the second sentence) are
AS> better to be put in the code, not the ChangeLog.  Everything should be
AS> understandable just by reading the code, even if the ChangeLogs are
AS> missing.
Agreed and noted.  Thanks.

Ok, here comes the hopefully final version.

Andreas

1999-07-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* linuxthreads/internals.h: Align _pthread_descr_struct to 32
	bytes.
	Reported by Tim Hockin <thockin@cobaltnet.com>, close PR
	libc/1206.

--- linuxthreads/internals.h.~1~	Sat Jul 10 01:14:10 1999
+++ linuxthreads/internals.h	Fri Jul 16 15:34:55 1999
@@ -106,7 +106,11 @@
   size_t p_guardsize;		/* size of guard area */
   pthread_descr p_self;		/* Pointer to this structure */
   int p_nr;                     /* Index of descriptor in __pthread_handles */
-};
+} __attribute__ ((aligned(32))); /* We need to align the structure so that
+				    doubles are aligned properly.  This is 8 bytes
+				    on MIPS and 16 bytes on MIPS64.  32 bytes might
+				    give better cache utilization.  */
+				    
 
 /* The type of thread handles. */
 



-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]