Path: chuka.playstation.co.uk!news From: Chris Chadwick Newsgroups: scee.yaroze.programming.gnu_compiler Subject: Re: Memory allocation probs... Date: Wed, 29 Oct 1997 00:57:03 -0800 Organization: PlayStation Net Yaroze (SCEE) Lines: 31 Message-ID: <3456FA5F.DB8@dial.pipex.com> References: <34551BB5.58BA@dial.pipex.com> <3454c596.21265918@news.playstation.co.uk> <3456076E.92B9FC58@micronetics.com> NNTP-Posting-Host: an142.du.pipex.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.02 (Win95; I; 16bit) Thanks to all who replied to my post! James Russell: Im linking to 80100000 because I load all my data/TIMs into low mem, before the prog. Where in mem do you load your data files? Jim wrote: > > Chris: > As far as memory allocation goes are you calling the mem alloc init > function thing? When I played with this last I seam to remember having > to do an init before I started allocating memory. > Yes, I'm sure you're right. I've just looked in malloc.h and there's a prototype for an InitHeap() function. Ill check this out but I *had* thought I'd managed to sort the problem, anyway. You see, when I was testing by trying to allocate mem for 20000 sprites (as in original post), I *forgot* that I was also using numSprites (20000) to allocate two static arrays of GsLINE & GsBOX objects for collision detection testing, while debugging. After I'd chopped these out, calloc() returned NULL, as expected, when unable to allocate mem. Still, I'm a bit surprised I didn't get any kind of compiler/linker warning if there was a problem with the two huge, static arrays in the first place. I'm probably showing my lack of compiler knowledge, but Im not proud (Gil, stop laughing :) Until the next time! Chris