Path: chuka.playstation.co.uk!news From: gil@snsys.com (Gil Jaysmith) Newsgroups: scee.yaroze.programming.gnu_compiler Subject: Re: GNU Malloc (was Re: Memory allocation probs...) Date: Fri, 31 Oct 1997 12:08:14 GMT Organization: SN Systems Lines: 26 Message-ID: <3459c89d.3383555@news.playstation.co.uk> References: <34551BB5.58BA@dial.pipex.com> <345915E7.11D17D58@forefront.com.au> Reply-To: gil@snsys.com NNTP-Posting-Host: gil.snsys.com X-Newsreader: Forte Free Agent 1.11/32.235 Toby Sargeant wrote: >I have a port of GNU malloc done for the psx, if anyone wants it. I've never >bothered to do timings against the psx version, though, so I can't say what the >advantages are likely to be. I'd expect it to either be faster, or be more >efficient at the memory it returns to the malloc arena. Knowing the Sony implementation of the first malloc sublibrary, it's likely to be both :) >One of the nice (IMHO) features that my port has is that you can specify the >size and position of the malloc arena, rather than being forced to give it the >memory from the top of your code to the top of memory. Unfortunately, given >that there's no memory managment (I thought that the R3000 _did_ have memory >management. has this just been ripped out, was it external, or is it just >disabled?)... The R3000's TLB was disabled in the PSX. (The only use for its control registers now is to provide a sneaky implementation of hardware memory watches :) You can call InitHeap to recast the start address and size of the heap however you like (sort of), so it's not like the malloc arena has to be permanently huge. Just don't do it after you've allocated anything after the default InitHeap call. - Gil