* Fixed a bad bug (that I introduced with one of the last commits...) that
could check memory beyond the block and then tried to allocate that on the correct block (would possibly lead to KDL). * Made AllocationBlock::Allocate() and Free() inline. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28117 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -154,8 +154,8 @@ class AllocationBlock : public CachedBlock {
|
||||
public:
|
||||
AllocationBlock(Volume* volume);
|
||||
|
||||
void Allocate(uint16 start, uint16 numBlocks);
|
||||
void Free(uint16 start, uint16 numBlocks);
|
||||
inline void Allocate(uint16 start, uint16 numBlocks);
|
||||
inline void Free(uint16 start, uint16 numBlocks);
|
||||
inline bool IsUsed(uint16 block);
|
||||
|
||||
status_t SetTo(AllocationGroup& group, uint16 block);
|
||||
@@ -755,7 +755,7 @@ BlockAllocator::AllocateBlocks(Transaction& transaction, int32 group,
|
||||
int32 range = 0, rangeStart = 0;
|
||||
int32 groupLargestStart = -1;
|
||||
int32 groupLargest = -1;
|
||||
int32 current = block * bitsPerFullBlock + start;
|
||||
int32 current = start;
|
||||
bool canUseLargest = start == 0;
|
||||
|
||||
for (; block < fGroups[group].NumBlocks(); block++) {
|
||||
|
||||
Reference in New Issue
Block a user