Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: jamin1@psu.edu (Jamin Frederick) Newsgroups: scea.yaroze.programming.2d_graphics Subject: Re: I can't stand it anymore! Date: Tue, 02 Jun 1998 22:26:05 GMT Organization: SCEA News Server Lines: 29 Message-ID: <357479f7.106779210@news.scea.sony.com> References: <35736b7c.12437918@news.scea.sony.com> Reply-To: jamin1@psu.edu NNTP-Posting-Host: MAXWELL.hq.ensco.com X-Newsreader: Forte Free Agent 1.11/32.235 On Tue, 02 Jun 1998 03:11:44 GMT, antony.arciuolo@mail.trincoll.edu (Antony Arciuolo) wrote: >I will ask the stupid question. How do you load files into main memory >and prevent them from being overwritten by the code allocating memory? > When you malloc() memory, you're adding space to the heap, which grows up from the (static) program code. The stack, which grows down from where you set it, is allocated from function calls and local variables. So what most people do is this: Stack (top of allowed yaroze space) | * (hope stack & heap don't collide!) * | Heap Code (Loaded above Data) Data (Loaded @ 90080000 and up -- bottom of allowed yaroze space) Jamin