Path: utzoo!mnetor!uunet!ncc!alberta!att-ih!pacbell!ames!lll-lcc!well!shf From: shf@well.UUCP (Stuart H. Ferguson) Newsgroups: comp.sys.amiga Subject: Re: malloc() prob. on 3.4a Message-ID: <5725@well.UUCP> Date: 17 Apr 88 03:37:45 GMT References: <8804160509.AA08340@cory.Berkeley.EDU> Reply-To: shf@well.UUCP (Stuart H. Ferguson) Organization: The Blue Planet Lines: 24 The discussion is about using "void *" on AllocMem() and how much more readable this is. I use a couple of macros, to wit: #define NEW(typ) (typ*)AllocMem((LONG)sizeof(typ),0L) #define FREE(p,typ) FreeMem(p,(LONG)sizeof(typ)) #define NEW_N(typ,n) (typ*)AllocMem((LONG)((n)*sizeof(typ)),0L) #define FREE_N(p,typ,n) FreeMem(p,(LONG)((n)*sizeof(typ))) So when I want a new "struct Blorch," I just say, foo = NEW(struct Blorch); Reminds my of my Pascal days ... ;-) This is actually a religious issue, more or less, but I don't really have anything agaist "void *". The macros work on any "C," as far as I know, however. -- Stuart Ferguson (shf@well.UUCP) Action by HAVOC (shf@Solar.Stanford.EDU)