[fpc-devel] cmem not aligning memory

Marco van de Voort marcov at stack.nl
Tue Apr 6 14:01:44 CEST 2010


In our previous episode, Michael Schnell said:
> > No, calloc simply zeroes the allocated memory.
> 
> So why does it provide a size argument ? Just to zero the information it
> would suffice to give it a byte count as with malloc().

I don't know, but the FreeBSD manpage says:

 The calloc() function allocates space for number objects, each size bytes
     in length.  The result is identical to calling malloc() with an
argument
     of ``number * size'', with the exception that the allocated memory is
     explicitly initialized to zero bytes.

Note the .. identical to calling malloc .. except .. initialized to zero
bytes,

which is exactly what Jonas says.



More information about the fpc-devel mailing list