Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ub.d.umn.edu!cs.umn.edu!uc!uf!mpp From: mpp@uf.msc.umn.edu (Mike Pritchard) Newsgroups: comp.unix.cray Subject: Re: Malloc() under UNICOS Message-ID: Date: 29 Aug 90 22:40:21 GMT References: <5931@castle.ed.ac.uk> <5998@castle.ed.ac.uk> Sender: news@uc.msc.umn.edu Lines: 21 refson@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@msc.umn.edu "Go that way. Really fast. If something gets in your way -- turn."