home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!utcsri!newsflash.concordia.ca!garrot.DMI.USherb.CA!uxa.ecn.bgu.edu!mp.cs.niu.edu!ux1.cso.uiuc.edu!uwm.edu!zaphod.mps.ohio-state.edu!caen!nic.umass.edu!noc.near.net!news.centerline.com!jimf
- From: jimf@centerline.com (Jim Frost)
- Newsgroups: comp.windows.x
- Subject: Re: FLAME, FLAME ON X!!!
- Date: 17 Nov 1992 21:45:16 GMT
- Organization: CenterLine Software, Inc.
- Lines: 33
- Message-ID: <1ebp5cINNp7c@armory.centerline.com>
- References: <1992Nov11.152545.1929@westford.ccur.com>
- NNTP-Posting-Host: 140.239.3.202
-
- black@westford.ccur.com (Samuel Black) writes:
- >>Actually, I once saw a malloc package that could be made to return some
- >>memory to the operating system by clever use of sbrk and brk, but I doubt
- >>that any X11 servers are written using such a technique. Might be an
- >>interesting experiment for some vendor, though ...
-
- I've written such a thing, actually. It's not particularly difficult
- although it becomes a question of whether it's smarter to do the
- correct brk/sbrk or to hang onto the piece (the brk/sbrk requires a
- system call which you'd prefer to avoid). I dealt with that issue by
- never doing a negative sbrk unless I had the whole piece that I got
- when I did the positive sbrk, but a threshold is probably a better
- approach.
-
- >Now, if we just had an OS that provided support for sparse memory spaces, ...
-
- AIX does so by default. In my opinion it's one of its most annoying
- features since it means that an allocation can fail well after it's
- made, making it similar to programming floating-point code on a chip
- with a long pipeline -- you know you'll get the error condition but
- you have no idea when. For applications which want sparse memory
- spaces this behavior is wonderful, though. (It's actually not
- difficult to get traditional malloc behavior under AIX by touching
- every page you get back from malloc, but it's one more detail to think
- about.)
-
- AIX also provides a new system call, disclaim(), which can be used to
- free VM pages that you don't care about anymore. That's much better
- granularity than brk/sbrk and would be a *really* nice thing to make
- use of in a malloc package.
-
- jim frost
- jimf@centerline.com
-