Let's do the same thing we did above with the last commit here too and make use
of the partitions list being ordered by physical offsets. This makes the code a
little simpler.
Partition *last_partition = NULL;
LIST_FOREACH(partitions, p, context->partitions)
- if (p->allocated_to_area == a)
+ if (p->allocated_to_area == a || p->padding_area == a)
last_partition = p;
if (last_partition) {
assert(last_partition->new_padding != UINT64_MAX);
last_partition->new_padding += round_down_size(span, context->grain_size);
- } else if (a->after) {
- assert(a->after->new_padding != UINT64_MAX);
- a->after->new_padding += round_down_size(span, context->grain_size);
}
}