A pending item in my tree I might as well check in: I plan to migrate calloc()
and bb_calloc() calls to bb_xzalloc() which allocates prezeroed memory but only takes one argument (the size).
This commit is contained in:
@ -37,6 +37,15 @@ void *xrealloc(void *ptr, size_t size)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_xzalloc
|
||||
void *xzalloc(size_t size)
|
||||
{
|
||||
void *ptr = xmalloc(size);
|
||||
memset(ptr, 0, size);
|
||||
return ptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef L_xcalloc
|
||||
void *xcalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
|
Reference in New Issue
Block a user