Path: chuka.playstation.co.uk!news From: richard.cutting@virgin.net (Richard Cutting) Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: argh Date: Fri, 27 Nov 1998 00:22:06 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 40 Message-ID: <365deffd.744056@news.playstation.co.uk> References: <73i0rg$9ia6@chuka.playstation.co.uk> <73j1ld$9ia11@chuka.playstation.co.uk> <73jj6i$9ia13@chuka.playstation.co.uk> <365D5685.328E0BF5@scee.sony.co.uk> <365E5672.47F4@dial.pipex.com> NNTP-Posting-Host: p11-crow-gui.tch.virgin.net X-Newsreader: Forte Free Agent 1.11/32.235 On Thu, 26 Nov 1998 23:36:18 -0800, Chris Chadwick wrote: >Ooops, sorry James. I meant to send that message to the news groups >but clicked the email button by mistake... > >-Chris > > James Russell wrote: > > > > Nigel Critten wrote: > > > > > > below is what I'm doing to allocate the memory > > > > > > u_long *image = (u_long *)malloc ((grabwidth*grabheight/2+5)*4); > > > > > > this causes a freeze. > > > > Have you called InitHeap? You must do this before using malloc. > > > > Oh. I've been using malloc/calloc for ages now without calling InitHeap > and never had any problems. I remeber I was going to use InitHeap but > found the parameters confusing, or something. Besides, I seem to recall > reading somewhere that initialization code does a heap initialization, > so an explicit InitHeap call isn't strictly necessary. What's the story? > > Cheers, > > -Chris It looks like this is where the manuals are slightly crap. If you look at malloc it never mentions 'InitHeap'. But if you look at 'InitHeap' ( which I'd really think to do before calling malloc !!! ) it states 'InitHeap initialises the group of memory control functions. Thereafter, malloc() etc can be used."..... Really bloody intuitive..... Richard.