Malloc() under UNICOS
Mike Pritchard
mpp at uf.msc.umn.edu
Thu Aug 30 08:40:21 AEST 1990
refson at castle.ed.ac.uk (Keith Refson) writes:
>Now comes the curious part. To see what was actually going on I
>replaced the calloc() call with malloc() and memset() (in my interface
>function which handles all memory allocation). The time spent in
>memory allocation (malloc()+memset()) decreased by a factor of 3
>compared with calloc()! Now surely calloc() should be entirely
>equivalent to calling malloc()+memset(). Is there some gross
>inefficiency in Cray's implementation of calloc() ? I am using C
>version 5.0, but I don't know the library version.
This is a problem with the X-MP calloc(). It clears the memory
out in a big for loop instead of using memset(). Calloc() is implemented
as a malloc() and memset() call on the Cray-2. I just filed a problem
report on this, so Cray should fix this in the next release.
-Mike
--
Mike Pritchard
Internet: mpp at msc.umn.edu
"Go that way. Really fast. If something gets in your way -- turn."
More information about the Comp.unix.cray
mailing list