Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!pasteur!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: Structure alignment in Manx C Message-ID: <8802160646.AA14996@cory.Berkeley.EDU> Date: 16 Feb 88 06:46:15 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 21 > short mem[(sizeof(struct FileInfoBlock) >> 1)+1]; > struct FileInfoBlock *fi; > > fi = (struct FileInfoBlock *)(((ULONG)(mem) & 3) ? &mem[1] : &mem[0]); > >Now, is that gross code or what? >--Chuck McManis Definately, but it sure beats having to AllocMem() the block. It would be nice if one could have a salloc() call ... allocate memory off the stack. Although Aztec (and lattice?) use a frame pointer, they apparaently also push and pop the registers using the stack pointer, so the call would have to be implemented like: ptr = salloc(bytes) (allocates on a longword boundry) spop() pops the allocated stack frame, must call before return statement / end of subroutine. -Matt