Memory allocation techniques

Henry Spencer henry at utzoo.uucp
Sun Sep 18 07:13:10 AEST 1988


In article <415 at marob.MASA.COM> daveh at marob.masa.com (Dave Hammond) writes:
>(1) Why the switch from sbrk() to malloc()?  Speed ?  Portability ?
>    Dependability ?  ...

Unlikely to be speed; probably a combination of portability and dependability.
The former because the interface to sbrk gets strange on machines which have
strange memory structures, while malloc can hide the gory details.  The
latter because it's increasingly common for library functions to use malloc,
which can royally foul up a program that uses sbrk and assumes it has sole
control of it.
-- 
NASA is into artificial        |     Henry Spencer at U of Toronto Zoology
stupidity.  - Jerry Pournelle  | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list