mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-01 04:17:02 -05:00
Refactors vector operations.
This commit is contained in:
parent
29b411e3fe
commit
cae803bdfb
10 changed files with 75 additions and 76 deletions
16
util.h
16
util.h
|
|
@ -466,22 +466,20 @@ void* malloc_nofail_align(size_t size, void** freeptr);
|
|||
|
||||
/**
|
||||
* Safe aligned vector allocation.
|
||||
* Returns a vector of "count" pointers, each one pointing to a block of the specified "size".
|
||||
* The first "reverse" pointers are put in reverse memory offset order.
|
||||
* If no memory is available, it aborts.
|
||||
*/
|
||||
void** malloc_nofail_vector_align(size_t reverse, size_t count, size_t size, void** freeptr);
|
||||
void** malloc_nofail_vector_align(int nd, int n, size_t size, void** freeptr);
|
||||
|
||||
/**
|
||||
* Fills the memory vector with random data.
|
||||
*/
|
||||
void mrand_vector(int n, size_t size, void** vv);
|
||||
|
||||
/**
|
||||
* Tests the memory vector for RAM problems.
|
||||
* If a problem is found, it crashes.
|
||||
*/
|
||||
void mtest_vector(void** vv, size_t count, size_t size);
|
||||
|
||||
/**
|
||||
* Fills the memory vector with random data.
|
||||
*/
|
||||
void mrand_vector(void** vv, size_t count, size_t size);
|
||||
void mtest_vector(int n, size_t size, void** vv);
|
||||
|
||||
/**
|
||||
* Safe strdup.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue