From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 16067 invoked from network); 8 Jul 1999 18:33:53 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 8 Jul 1999 18:33:53 -0000 Received: from ellpspace.math.ualberta.ca (michal@ellpspace.math.ualberta.ca [129.128.88.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id LAA32069 for ; Tue, 29 Jun 1999 11:07:44 -0400 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.8.8/8.8.8) id JAA15833 for axp-list@redhat.com; Tue, 29 Jun 1999 09:07:40 -0600 From: Michal Jaegermann Message-Id: <199906291507.JAA15833@ellpspace.math.ualberta.ca> Subject: Re: problem with unaligned access on Alpha To: axp-list@redhat.com Date: Tue, 29 Jun 1999 09:07:40 -0600 (MDT) In-Reply-To: from "Wessels, Hans" at Jun 29, 99 11:12:48 am Content-Type: text Wessels, Hans wrote: > > On 25 juni 1999 Maciej W. Rozycki wrote: > > > Using unions is good when you are sure all data is aligned. If that's > >not the case, the problem remains. The "packed" approach is reasonable > >but not necessarily the best. .... > I am using the following macro to get alignment of elements in an > malloced memory block: [ snip ] Aligning your own data is usually not a very big problem. egcs does a pretty good job with it by itself; sometimes too good. :-) But from time to time you have to pick apart "alien" structures - like ethernet packet headers, or file system descriptors, or you name it. They have their own layout and alignment requirements, which you cannot change, and one has to be a bit careful not to run afoul of a compiler. Michal