mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-22 07:56:33 -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
|
|
@ -713,7 +713,10 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
|
|||
|
||||
failed = malloc_nofail(diskmax * sizeof(struct failed_struct));
|
||||
failed_map = malloc_nofail(diskmax * sizeof(unsigned));
|
||||
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;
|
||||
silent_error = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue