Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!stevec From: stevec@Apple.COM (Steve Christensen) Newsgroups: comp.sys.mac.programmer Subject: Re: Can I count on any alignment from NewHandle or NewPtr? Message-ID: <50238@apple.Apple.COM> Date: 14 Mar 91 01:05:03 GMT References: <3588@ux.acs.umn.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 18 In article <3588@ux.acs.umn.edu> dhoyt@vx.acs.umn.edu writes: > Can I count on any sort of alignment from the mac memory manager? Or do I >have to roll my own by allocating n-1 more bytes than I really need? > Also, is there any guarentee on stack alignment? I'm trying to build a >garbage collector for MacApp/C++ and it would be faster if I could rely on >alignment. As I recall, heap blocks are word aligned on 68000 Macs and are long word aligned on 68020 and 68030 Macs. The best you can hope for is word alignment on the stack since both word- and long word-sized values are stored on the stack... steve -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Steve Christensen Never hit a man with glasses. stevec@apple.com Hit him with a baseball bat.