home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14823 < prev    next >
Encoding:
Text File  |  1992-08-31  |  872 b   |  28 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!infonode!ingr!b11!billj
  3. From: billj@b11.b11.ingr.com (Bill Jones)
  4. Subject: Re: malloc in Think C
  5. Message-ID: <1992Sep1.002643.7531@b11.b11.ingr.com>
  6. Organization: Intergraph Corp. Huntsville, AL
  7. References: <25873@dog.ee.lbl.gov>
  8. Distribution: na
  9. Date: Tue, 1 Sep 1992 00:26:43 GMT
  10. Lines: 16
  11.  
  12. sichase@csa1.lbl.gov (SCOTT I CHASE) writes:
  13.  
  14. >char *array;
  15. >array = malloc(10000*sizeof(char));
  16.  
  17. >My question is:  Do I have to worry about memory moving around?  Will
  18. >array continue to point to the correct data regardless of what toolbox 
  19. >routines I use which scramble memory?  Do I have to do this with a handle
  20. >instead or does Think's implementation of malloc lock the memory for me? 
  21.  
  22. malloc makes a NewPtr() call, which gets you non-relocatable memory. It
  23. don't move around.
  24.  
  25. Bill Jones
  26. billj@beowulf.b11.ingr.com
  27.  
  28.