Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!uunet!wang!bu-tyng!three!cory From: cory@three.MV.COM (Cory Kempf) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW C malloc Message-ID: <401@three.MV.COM> Date: 5 Aug 90 02:53:26 GMT References: <23421@dartvax.Dartmouth.EDU> Organization: The Enigami Co. Nashua, NH. Lines: 37 llama@eleazar.dartmouth.edu (Joe Francis) writes: >We are starting a project of several related applications in MPW C++. >Long term plans include porting to other platforms. In the interest >of ease of porting, it would be nice to use malloc/free instead of the >mac specific memory manager calls. Uh, C++ defines "new" and "delete" as part of the language. Why not use them? >If any of you have experience with the MPW versions of these, could >you please answer the following questions: >1) How does malloc/free actually work on the mac? Just about the same way as it does on any other platform -- it allocates a block of memory on the application heap. (nb: malloc returns a pointer, so of course the block is non-relocatable) Free does about what you would expect. >2) How is the performance? Don't know, never found any need to run benchmarks on memory allocation. In general, I find that my bottlenecks are in other areas (then again, I usually don't call malloc/free from within a tight loop -- and never (so far) in C++) >3) Are there any problems you have run into? Other than as noted above, none. +C -- Cory Kempf I do speak for the company (sometimes). The Enigami Co. 603 883 2474 email: cory@three.mv.com, harvard!zinn!three!cory