Adds a basic memory test on the used memory buffers.

This commit is contained in:
Andrea Mazzoleni 2013-10-27 17:31:10 +01:00
parent e7804a5f8f
commit 7414f8daec
8 changed files with 67 additions and 0 deletions

View file

@ -482,6 +482,8 @@ static int state_check_process(struct snapraid_state* state, int check, int fix,
buffermax = diskmax + state->level * 2 + 1;
buffer = malloc_nofail_vector_align(buffermax, state->block_size, &buffer_alloc);
if (!state->opt.skip_self)
mtest_vector(buffer, buffermax, state->block_size);
/* fill up the zero buffer */
memset(buffer[buffermax-1], 0, state->block_size);