Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!ugle.unit.no!hanche From: hanche@imf.unit.no (Harald Hanche-Olsen) Newsgroups: comp.sys.mac.programmer Subject: Re: malloc() in Think C programming on the Mac Message-ID: Date: 24 Jan 91 16:57:21 GMT References: <1991Jan24.060336.12684@nlm.nih.gov> Sender: news@ugle.unit.no Distribution: comp Organization: The Norwegian Institute of Technology, Trondheim, Norway. Lines: 20 In-Reply-To: usenet@nlm.nih.gov's message of 24 Jan 91 06:03:36 GMT In article <1991Jan24.060336.12684@nlm.nih.gov> usenet@nlm.nih.gov (usenet news poster) writes: I have code that compiles and runs under Unix and MSDOS. On the Mac, it compiles without error and runs most of the time, however calls to malloc(() which on the other operating systems return a pointer and space reture null on the Macintosh (using the Think C console.h and ANSI libraries). You probably asked for more memory than is available. (Always have your program check for a NULL return from malloc(), right?) If you need to ask for large chunks of memory, try increasing your application's multifinder partition size. Did you remember to #include ? If not, you may have a long/short type conflict in the arguments to malloc... - Harald Hanche-Olsen Division of Mathematical Sciences The Norwegian Institute of Technology N-7034 Trondheim, NORWAY