4 extern unsigned long strtoul ( const char *p, char **endp, int base );
5 extern void * realloc ( void *old_ptr, size_t new_size );
6 extern void * malloc ( size_t size );
7 extern void free ( void *ptr );
8 extern int system ( const char *command );
9 extern long int random ( void );
12 * Allocate cleared memory
14 * @v nmemb Number of members
15 * @v size Size of each member
16 * @ret ptr Allocated memory
18 * Allocate memory as per malloc(), and zero it.
20 * Note that malloc() and calloc() are identical, in the interests of
21 * reducing code size. Callers should not, however, rely on malloc()
22 * clearing memory, since this behaviour may change in future.
24 static inline void * calloc ( size_t nmemb, size_t size ) {
25 return malloc ( nmemb * size );