malloc(3) vs. malloc(3x)

Gordon Cross crossgl at ingr.com
Tue Jan 10 01:09:35 AEST 1989


In article <1418 at leah.Albany.Edu> rds95 at leah.Albany.Edu (Robert Seals) writes:
>How much can a single malloc get? And why does Ultrix have 2 kinds of
>malloc, while 4.3-tahoe (the first one, I think) only has 1?

The difference between malloc(3C) and malloc (3X) is speed:  the latter version
runs on average about 9 times faster.  The algorithm used is optimized for
speed at the expense of memory efficiency.  If you are going to do LOTS of
mallocs, the 3X version is usually preferable.
-- 

Gordon Cross             UUCP:      uunet!ingr!crossgl     "all opinions are
111 Westminister Way     INTERNET:  crossgl at ingr.com        mine and not those
Madison, AL 35758        MA BELL:   (205) 772-7842          of my employer."



More information about the Comp.unix.questions mailing list