mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-03 21:30:14 -05:00
Allocate only the minimal necessary waiting vector
This is more clear to understand.
This commit is contained in:
parent
377352e64f
commit
affc60e256
3 changed files with 10 additions and 3 deletions
|
|
@ -191,7 +191,9 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
|
|||
/* initialize the io threads */
|
||||
io_init(&io, state, state->opt.io_cache, buffermax, dry_data_reader, handle, diskmax, dry_parity_reader, 0, parity_handle, state->level);
|
||||
|
||||
waiting_map = malloc_nofail((diskmax + RAID_PARITY_MAX) * sizeof(unsigned));
|
||||
/* possibly waiting disks */
|
||||
waiting_mac = diskmax > RAID_PARITY_MAX ? diskmax : RAID_PARITY_MAX;
|
||||
waiting_map = malloc_nofail(waiting_mac * sizeof(unsigned));
|
||||
|
||||
error = 0;
|
||||
io_error = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue