Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!athena.mit.edu!rsfinn From: rsfinn@athena.mit.edu (Russell S. Finn) Newsgroups: comp.sys.mac.programmer Subject: Re: Malloc Message-ID: <15782@bloom-beacon.MIT.EDU> Date: 10 Nov 89 00:11:16 GMT References: <5804@ucdavis.ucdavis.edu> <32366@ucbvax.BERKELEY.EDU> <73658@tut.cis.ohio-state.edu> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: rsfinn@athena.mit.edu (Russell S. Finn) Organization: Massachusetts Institute of Technology Lines: 16 In article <73658@tut.cis.ohio-state.edu> william c ray writes: >Probably another stupid question, but here goes... I've been trying to >convert some lightspeed C (3.02) projects over to Think 4.0, and keep getting >the same problem. Mallocs that used to work just fine, are returning >out-of-memory. The same thing happens with calloc, etc. Is this a known >4.0 bug? is there a fix for it? I can manage to allocate maybe 50 bytes >before I get a Null... Anyone have any ideas? THINK C 4.0 now follows the ANSI rules for libraries, and one of the things that changed is that malloc et al. now take an argument of type size_t, not int. Under THINK C 4.0 size_t is a long. I trust the problem is now obvious. Including the appropriate header file (stdlib.h?) will help find problems like these, since it should contain prototypes for the functions in question. -- Russ