Re: memorize

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 10/05/97


On Thu, 2 Oct 1997, Daniel Koepke wrote:

>Uhm, what's the point?  calloc() is just malloc() that takes
>an extra parameter.  They do (essentially) the same thing.
>
>  data = (type *) calloc(sizeof(type), elements);
>
>is (again, essentially) the same as
>
>  data = (type *) malloc(sizeof(type)*elements);

Except calloc zero's out the bytes.

The point is that you should use the CREATE macro so that you can change it
later if you want to do something, like say, log allocations.

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST