home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!sun-barr!sh.wide!wnoc-tyo-news!scslwide!wsgw!wsservra!daemon
- From: jimf@centerline.com (Jim Frost)
- Newsgroups: fj.mail-lists.x-window
- Subject: Re: FLAME, FLAME ON X!!!
- Message-ID: <1992Nov18.105212.9864@sm.sony.co.jp>
- Date: 18 Nov 92 10:52:12 GMT
- Sender: daemon@sm.sony.co.jp (The devil himself)
- Distribution: fj
- Organization: CenterLine Software, Inc.
- Lines: 39
- Approved: michael@sm.sony.co.jp
-
- Date: 17 Nov 92 21:45:16 GMT
- Message-Id: <1ebp5cINNp7c@armory.centerline.com>
- Newsgroups: comp.windows.x
- References: <1992Nov11.152545.1929@westford.ccur.com>
- Sender: xpert-request@expo.lcs.mit.edu
-
- 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
-