home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- 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
- From: d88-jwa@feffe.nada.kth.se (Jon WΣtte)
- Subject: Re: A malloc() built upon sbrk() on a Mac?
- Message-ID: <1993Jan28.165054.9932@kth.se>
- Sender: usenet@kth.se (Usenet)
- Nntp-Posting-Host: feffe.nada.kth.se
- Organization: Royal Institute of Technology, Stockholm, Sweden
- References: <BOORTZ.93Jan27115728@dunlop.sics.se> <1k6qsbINNkpd@geraldo.cc.utexas.edu>
- Date: Thu, 28 Jan 1993 16:50:54 GMT
- Lines: 30
-
- In <1k6qsbINNkpd@geraldo.cc.utexas.edu> Chris Johnson <chrisj@emx.cc.utexas.edu> writes:
-
- >In article <1993Jan27.164137.29669@kth.se> Jon W!tte,
-
- >>>3. Implement sbrk() with SetPtrSize() on this memory area
- >>> and let malloc() take memory from this area.
- >>
- >>Bad Idea. SetPtrSize may move the block, which invalidates all
- >>your present pointers into it. Not to mention there might be another
- >>locked block (ptr or locked handle that isn!t movehhid) in its way.
-
- >SetPtrSize can't move its target block because it only operates on
- >non-relocatable blocks (blocks allocated with NewPtr). SetHandleSize,
-
- Yes, I was suffering from brain damage.
-
- >SetPtrSize, of course, frequently fails because non-relocatable blocks
- >are allocated as low in the heap as possible (to minimize fragmentation)
-
- That's the real reason it won't work very well.
- Turned out the original poster was sitting a few klicks
- from here, so we had a giving discussion in Swedish :-)
-
- Cheers,
-
- / h+
- --
- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
-
- -- I don't fear death, it's dying that scares me.
-