Changeset 2a9543d in mainline
- Timestamp:
- 2005-09-28T13:22:21Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 40a468a
- Parents:
- 32ff43e6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mm/buddy.c
r32ff43e6 r2a9543d 163 163 ASSERT(i < b->max_order); 164 164 165 /* 166 * See if there is any buddy in the list of order i. 167 */ 168 buddy = b->op->find_buddy(block); 169 170 if (buddy && i != b->max_order - 1) { 171 172 ASSERT(b->op->get_order(buddy) == i); 173 165 if (i != b->max_order - 1) { 174 166 /* 175 * Remove buddy fromthe list of order i.167 * See if there is any buddy in the list of order i. 176 168 */ 177 list_remove(buddy); 178 179 /* 180 * Invalidate order of both block and buddy. 181 */ 182 b->op->set_order(block, BUDDY_SYSTEM_INNER_BLOCK); 183 b->op->set_order(buddy, BUDDY_SYSTEM_INNER_BLOCK); 184 185 /* 186 * Coalesce block and buddy into one block. 187 */ 188 hlp = b->op->coalesce(block, buddy); 189 190 /* 191 * Set order of the coalesced block to i + 1. 192 */ 193 b->op->set_order(hlp, i + 1); 194 195 /* 196 * Recursively add the coalesced block to the list of order i + 1. 197 */ 198 buddy_system_free(b, hlp); 169 buddy = b->op->find_buddy(block); 170 if (buddy) { 171 172 ASSERT(b->op->get_order(buddy) == i); 173 174 /* 175 * Remove buddy from the list of order i. 176 */ 177 list_remove(buddy); 178 179 /* 180 * Invalidate order of both block and buddy. 181 */ 182 b->op->set_order(block, BUDDY_SYSTEM_INNER_BLOCK); 183 b->op->set_order(buddy, BUDDY_SYSTEM_INNER_BLOCK); 184 185 /* 186 * Coalesce block and buddy into one block. 187 */ 188 hlp = b->op->coalesce(block, buddy); 189 190 /* 191 * Set order of the coalesced block to i + 1. 192 */ 193 b->op->set_order(hlp, i + 1); 194 195 /* 196 * Recursively add the coalesced block to the list of order i + 1. 197 */ 198 buddy_system_free(b, hlp); 199 return; 200 } 199 201 } 200 else { 201 /* 202 * Insert block into the list of order i. 203 */ 204 list_append(block, &b->order[i]); 205 } 202 203 /* 204 * Insert block into the list of order i. 205 */ 206 list_append(block, &b->order[i]); 206 207 207 208 }
Note:
See TracChangeset
for help on using the changeset viewer.