Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!bloom-beacon!gatech!hubcap!ncrcae!ncr-sd!hp-sdd!hplabs!decwrl!labrea!rocky!rokicki From: rokicki@rocky.STANFORD.EDU (Tomas Rokicki) Newsgroups: comp.sys.amiga Subject: Structure alignment in Manx C Keywords: Watch out! Message-ID: <1042@rocky.STANFORD.EDU> Date: 13 Feb 88 20:54:14 GMT Organization: Stanford University Computer Science Department Lines: 28 I just tracked down this bug that took me immense amounts of time to find, and I discovered something about Manx C. I found out that one of my friends had also run into and wasted hours finding this anomaly. Specifically, Manx C does not long-word align structures containing long words! (It also doesn't apparently long-word align long words.) The ramifications of this are two-fold: - Programs compiled with Manx C and then run on a 68020 system will run slower, as some (probably half) of their long word accesses will need two memory accesses instead of one. - You cannot statically allocate anything that needs to be on a long word boundary; for instance, packets. (Not that you should anyway, as they should be MEMF_PUBLIC, but with the current release that doesn't matter anyway.) Anything that will be converted to a BPTR and back will have problems. Oh yeah, this is Manx 3.4b. I can't think of any good way to fix this problem; I refuse to recompile all my programs with 32-bit ints. Why did Manx do this? The only case where it costs anything is in passing arguments to subroutines; all other occurances would cost very little memory at all. And subroutine arguments could be handled as they are now, or perhaps modified. I don't care. What does Lattice do (4.0), anyone out there know? -tom