home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22366 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.6 KB  |  43 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!pageworks.com!world!eff!sol.ctr.columbia.edu!emory!swrinde!gatech!udel!intercon!psinntp!sunic!kth.se!feffe.nada.kth.se!d88-jwa
  3. From: d88-jwa@feffe.nada.kth.se (Jon WΣtte)
  4. Subject: Re: A malloc() built upon sbrk() on a Mac?
  5. Message-ID: <1993Jan28.165054.9932@kth.se>
  6. Sender: usenet@kth.se (Usenet)
  7. Nntp-Posting-Host: feffe.nada.kth.se
  8. Organization: Royal Institute of Technology, Stockholm, Sweden
  9. References: <BOORTZ.93Jan27115728@dunlop.sics.se> <1k6qsbINNkpd@geraldo.cc.utexas.edu>
  10. Date: Thu, 28 Jan 1993 16:50:54 GMT
  11. Lines: 30
  12.  
  13. In <1k6qsbINNkpd@geraldo.cc.utexas.edu> Chris Johnson <chrisj@emx.cc.utexas.edu> writes:
  14.  
  15. >In article <1993Jan27.164137.29669@kth.se> Jon W!tte,
  16.  
  17. >>>3.    Implement sbrk() with SetPtrSize() on this memory area
  18. >>>    and let malloc() take memory from this area.
  19. >>
  20. >>Bad Idea. SetPtrSize may move the block, which invalidates all
  21. >>your present pointers into it. Not to mention there might be another
  22. >>locked block (ptr or locked handle that isn!t movehhid) in its way.
  23.  
  24. >SetPtrSize can't move its target block because it only operates on
  25. >non-relocatable blocks (blocks allocated with NewPtr). SetHandleSize, 
  26.  
  27. Yes, I was suffering from brain damage.
  28.  
  29. >SetPtrSize, of course, frequently fails because non-relocatable blocks
  30. >are allocated as low in the heap as possible (to minimize fragmentation)
  31.  
  32. That's the real reason it won't work very well.
  33. Turned out the original poster was sitting a few klicks
  34. from here, so we had a giving discussion in Swedish :-)
  35.  
  36. Cheers,
  37.  
  38.                         / h+
  39. -- 
  40.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  41.  
  42.  -- I don't fear death, it's dying that scares me.
  43.