Allocate and zero-fill memory.
- nmemb
- Number of objects to allocate.
- size
- Size of each object to allocate.
The calloc function returns a pointer to the allocated memory if successful; otherwise IntPtr.Zero is returned and Stdlib.GetLastError returns Errno.ENOMEM.
The calloc() function allocates space for nmemb objects, each size bytes in length. The result is identical to calling Stdlib.malloc(3) with an argument of "nmemb * size," with the exception that the allocated memory is explicitly initialized to zero bytes.
The return value of calloc must be passed to Stdlib.free to avoid a memory leak.
Namespace: Mono.Unix.Native
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0