home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sun.misc:6087 comp.unix.solaris:447 comp.unix.misc:4785
- Path: sparky!uunet!auspex-gw!guy
- From: guy@Auspex.COM (Guy Harris)
- Newsgroups: comp.sys.sun.misc,comp.unix.solaris,comp.unix.misc
- Subject: Re: mallopt() a no-op in SunOS 4.1.x?
- Message-ID: <16184@auspex-gw.auspex.com>
- Date: 31 Dec 92 21:42:28 GMT
- References: <1hqdriINNh67@armory.centerline.com>
- Sender: news@auspex-gw.auspex.com
- Followup-To: comp.unix.solaris
- Organization: Auspex Systems, Santa Clara
- Lines: 37
- Nntp-Posting-Host: auspex.auspex.com
-
- >Can anyone either verify or refute the observation that mallopt, although
- >it's present in the C library, seems to be a no-op in SunOS 4.1.x?
-
- Yup, I can verify it.
-
- The *only* place in the 4.1[.x] "malloc()" where it looks at, rather
- than just updating, any of the items in its internal "mallinfo"
- structure is a place where it updates "smblks"; the comment for that
- code reads "kludge to pass the SVVS", and all it does is, based on
- whether the number of bytes being returned by "malloc()" is bigger than
- "mxfast" or not, increment or not increment "smblks".
-
- The problem is that AT&T embedded the implementation quirks of their
- "-lmalloc" version of "malloc()" in the SVID; SunOS has traditionally
- used its own "malloc()" implementation - to quote a comment at the
- beginning of it, it's
-
- based on a method described in C.J. Stephenson, "Fast Fits"
-
- (i.e., it's neither the traditional V7 "malloc()", the Caltech
- "malloc()" used by BSD, nor the "-lmalloc" implementation in SV) - so
- those implementation quirks didn't apply.
-
- In order to obey the "letter of the law", the "mallopt" glop was stuck
- in; it doesn't affect the behavior of the implementation, it just
- provides some statistics that keep the SVVS happy.
-
- >Compiling and running the attached program on a variety of systems -- an
- >HP/700 running HP/UX 8, a sparc running SunOS 4.1.1, and a sparc running
- >Solaris 2.1 -- suggests that mallopt actually has some effect in HP/UX
- >and in Solaris, but no effect at all in SunOS 4.
-
- HP-UX probably uses the standard SVR2 or SVR3 "-lmalloc" implementation,
- and SunOS 5.x may use the standard SVR4 implementation rather than the
- implementation used by previous SunOS releases (I think the SVR4
- implementation may be different from the one used by previous SV
- systems, as well).
-