* One should not rely on the comma operator being evaluated right-to-left as

it was done in SAS/C... (yeah, that was ages ago). This fixes bug #2030.
* Also, we should probably check if the area we're about to shrink/remove
  actually is a reserved area.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29605 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-03-19 08:55:28 +00:00
parent c93232896f
commit defc7c56fb
1 changed files with 8 additions and 2 deletions

View File

@ -1187,8 +1187,12 @@ second_chance:
// TODO: it would make sense to start with the biggest of them
next = addressSpace->areas;
last = NULL;
for (last = NULL; next; next = next->address_space_next,
last = next) {
for (last = NULL; next; next = next->address_space_next) {
if (next->id != RESERVED_AREA_ID) {
last = next;
continue;
}
// TODO: take free space after the reserved area into
// account!
if (next->base == ROUNDUP(next->base, alignment)
@ -1216,6 +1220,8 @@ second_chance:
area->base = next->base + next->size;
break;
}
last = next;
}
}
break;