calloc vs. malloc

DARIN JOHNSON ee163acp at sdcc13.UUCP
Sun Apr 28 07:31:06 AEST 1985


There was a question on mod.unix (or something like that) about whether
interchanging malloc and calloc calls was portable.  Well I had a
problem with that just yesterday and it took quite a while to figure
out.  On the pyramid OSx it seems that if free() is called with
something calloc()'d it doesn't do what is expected.  I try to keep this
consistent, but I called free() instead of cfree() in one place, and
then later when calling malloc, it returned something still in use.
Replacing this free() with cfree() immediately solved the problem.

  Darin Johnson
  UCSD



More information about the Comp.unix mailing list