* upgrade jobs before calling this function. */
assert(left == 0);
vec_free(&available);
free(jobs->d);
jobs->d = sorted.d;
}