Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* Dealing with unaligned accesses
@ 1998-12-03  5:00 Oscar Levi
  1998-12-09  5:00 ` David Hagood
  0 siblings, 1 reply; 2+ messages in thread
From: Oscar Levi @ 1998-12-03  5:00 UTC (permalink / raw)


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?





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-12-09  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-12-03  5:00 Dealing with unaligned accesses Oscar Levi
1998-12-09  5:00 ` David Hagood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox