From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,ce1ac29ce5ab112d,start X-Google-Attributes: gid111c93,public From: Oscar Levi Subject: Dealing with unaligned accesses Date: 1998/12/03 Message-ID: <36673795.6C675A97@netcom.com>#1/1 X-Deja-AN: 418442741 X-Report: Report abuse to abuse@uswest.net. Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: 3 Dec 1998 19:15:00 +0600, 207.108.197.193 MIME-Version: 1.0 Newsgroups: comp.os.linux.alpha I'm working on eliminating some unaligned accesses in smail. It happens to be the case that the misalignment is due to a pointer, stored in a structure, that is not being accessed on a 64 bit boundary. My question is how to cope with this kind of problem. The message from the kernel says that address 2017fbec is where the access occurs. The data item at that address is an eight byte pointer. The first byte of the structure is at address 2017fbd4. This means that moving the pointer to the top of the structure won't help. In fact, the structure is an even number of 64 bits in length. When I look at the code, I see that this block is allocated by malloc. I would expect malloc to return 64 bit aligned memory. Humph. Does anyone know the correct solution to this kind of problem?