mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Adds cmalloc() wrapper.
This commit is contained in:
parent
ce2d03bd80
commit
0c65dbbb48
2 changed files with 11 additions and 0 deletions
|
|
@ -1505,6 +1505,11 @@ void* malloc_nofail(size_t size)
|
|||
return ptr;
|
||||
}
|
||||
|
||||
void* cmalloc_nofail(size_t count, size_t size)
|
||||
{
|
||||
return malloc_nofail(count * size);
|
||||
}
|
||||
|
||||
char* strdup_nofail(const char* str)
|
||||
{
|
||||
size_t size;
|
||||
|
|
|
|||
|
|
@ -464,6 +464,12 @@ size_t malloc_counter(void);
|
|||
*/
|
||||
void* malloc_nofail(size_t size);
|
||||
|
||||
/**
|
||||
* Safe cmalloc.
|
||||
* If no memory is available, it aborts.
|
||||
*/
|
||||
void* cmalloc_nofail(size_t count, size_t size);
|
||||
|
||||
/**
|
||||
* Safe aligned malloc.
|
||||
* If no memory is available, it aborts.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue