Path: utzoo!utgpu!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!iuvax!purdue!i.cc.purdue.edu!h.cc.purdue.edu!s.cc.purdue.edu!ain From: ain@s.cc.purdue.edu (Patrick White) Newsgroups: comp.sys.amiga.tech Subject: Re: Manxifying Lattice Code Message-ID: <3498@s.cc.purdue.edu> Date: 5 Aug 88 13:28:37 GMT References: <6711@well.UUCP: <386@stsci> Reply-To: ain@s.cc.purdue.edu.UUCP (Patrick White) Organization: PUCC Land, USA Lines: 22 In article <386@stsci> berry@stsci.EDU (Jim Berry) writes: >: pplanet = (tplanet *) malloc (sizeof(tplanet)); >: but when it tries to store to the structure, it (sometimes!) crashes with >: Guru 3. > >How big is sizeof(tplanet)? Manx malloc() wants its argument to be a word, so >if it's bigger than 64K it won't work correctly. I've got a program that malloc's more than 64K and it works fine -- in fact, it sort of a version of empire that I've been writing/toying with. Of course, I'm using +pCD options on the compiles. (could it be that malloc expects an *unsigned int* as it's argument and this way, I get to pass it a 32-bit value?) >If that's the case, try AllocMem(). This certainly works, but be *very* sure to free it when you are done (Manx frees any malloc'd memory that you forgot to. -- Pat White ARPA/UUCP: k.cc.purdue.edu!ain BITNET: PATWHITE@PURCCVM PHONE: (317) 743-8421 U.S. Mail: 320 Brown St. apt. 406, West Lafayette, IN 47906