home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!att!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!dog.ee.lbl.gov!csa1.lbl.gov!sichase
- From: sichase@csa1.lbl.gov (SCOTT I CHASE)
- Newsgroups: comp.sys.mac.programmer
- Subject: malloc in Think C
- Date: 30 Aug 92 20:52:35 GMT
- Organization: Lawrence Berkeley Laboratory - Berkeley, CA, USA
- Lines: 20
- Distribution: na
- Message-ID: <25873@dog.ee.lbl.gov>
- Reply-To: sichase@csa1.lbl.gov
- NNTP-Posting-Host: 128.3.254.196
- News-Software: VAX/VMS VNEWS 1.3-4
-
- Sorry to ask such a newbie question. I'm sure that this has been discussed
- many times. But I never paid close attention until it came up for me yesterday.
- Due to a "data segment too big" message when trying to use the debugger,
- I had to dynamically allocate a 10K array, like this:
-
- char *array;
- array = malloc(10000*sizeof(char));
-
- My question is: Do I have to worry about memory moving around? Will
- array continue to point to the correct data regardless of what toolbox
- routines I use which scramble memory? Do I have to do this with a handle
- instead or does Think's implementation of malloc lock the memory for me?
-
- -Scott
- --------------------
- Scott I. Chase "The question seems to be of such a character
- SICHASE@CSA2.LBL.GOV that if I should come to life after my death
- and some mathematician were to tell me that it
- had been definitely settled, I think I would
- immediately drop dead again." - Vandiver
-