VMUserAddressSpace: Small coding style fixes
This commit is contained in:
@@ -574,7 +574,6 @@ second_chance:
|
|||||||
addr_t nextBase = next == NULL
|
addr_t nextBase = next == NULL
|
||||||
? end : std::min(next->Base() - 1, end);
|
? end : std::min(next->Base() - 1, end);
|
||||||
if (is_valid_spot(start, alignedBase, size, nextBase)) {
|
if (is_valid_spot(start, alignedBase, size, nextBase)) {
|
||||||
|
|
||||||
addr_t rangeEnd = std::min(nextBase - size + 1, end);
|
addr_t rangeEnd = std::min(nextBase - size + 1, end);
|
||||||
if (is_randomized(addressSpec)) {
|
if (is_randomized(addressSpec)) {
|
||||||
alignedBase = _RandomizeAddress(alignedBase, rangeEnd,
|
alignedBase = _RandomizeAddress(alignedBase, rangeEnd,
|
||||||
@@ -597,7 +596,6 @@ second_chance:
|
|||||||
addr_t nextBase = std::min(end, next->Base() - 1);
|
addr_t nextBase = std::min(end, next->Base() - 1);
|
||||||
if (is_valid_spot(last->Base() + (last->Size() - 1),
|
if (is_valid_spot(last->Base() + (last->Size() - 1),
|
||||||
alignedBase, size, nextBase)) {
|
alignedBase, size, nextBase)) {
|
||||||
|
|
||||||
addr_t rangeEnd = std::min(nextBase - size + 1, end);
|
addr_t rangeEnd = std::min(nextBase - size + 1, end);
|
||||||
if (is_randomized(addressSpec)) {
|
if (is_randomized(addressSpec)) {
|
||||||
alignedBase = _RandomizeAddress(alignedBase,
|
alignedBase = _RandomizeAddress(alignedBase,
|
||||||
@@ -620,7 +618,6 @@ second_chance:
|
|||||||
alignment);
|
alignment);
|
||||||
if (next == NULL && is_valid_spot(last->Base() + (last->Size() - 1),
|
if (next == NULL && is_valid_spot(last->Base() + (last->Size() - 1),
|
||||||
alignedBase, size, end)) {
|
alignedBase, size, end)) {
|
||||||
|
|
||||||
if (is_randomized(addressSpec)) {
|
if (is_randomized(addressSpec)) {
|
||||||
alignedBase = _RandomizeAddress(alignedBase, end - size + 1,
|
alignedBase = _RandomizeAddress(alignedBase, end - size + 1,
|
||||||
alignment);
|
alignment);
|
||||||
@@ -632,7 +629,6 @@ second_chance:
|
|||||||
break;
|
break;
|
||||||
} else if (addressSpec == B_BASE_ADDRESS
|
} else if (addressSpec == B_BASE_ADDRESS
|
||||||
|| addressSpec == B_RANDOMIZED_BASE_ADDRESS) {
|
|| addressSpec == B_RANDOMIZED_BASE_ADDRESS) {
|
||||||
|
|
||||||
// we didn't find a free spot in the requested range, so we'll
|
// we didn't find a free spot in the requested range, so we'll
|
||||||
// try again without any restrictions
|
// try again without any restrictions
|
||||||
if (!is_randomized(addressSpec)) {
|
if (!is_randomized(addressSpec)) {
|
||||||
@@ -679,7 +675,6 @@ second_chance:
|
|||||||
if ((next->protection & RESERVED_AVOID_BASE) == 0
|
if ((next->protection & RESERVED_AVOID_BASE) == 0
|
||||||
&& alignedBase == next->Base()
|
&& alignedBase == next->Base()
|
||||||
&& next->Size() >= size) {
|
&& next->Size() >= size) {
|
||||||
|
|
||||||
addr_t rangeEnd = std::min(
|
addr_t rangeEnd = std::min(
|
||||||
next->Base() + next->Size() - size, end);
|
next->Base() + next->Size() - size, end);
|
||||||
if (is_randomized(addressSpec)) {
|
if (is_randomized(addressSpec)) {
|
||||||
@@ -711,7 +706,6 @@ second_chance:
|
|||||||
addr_t startRange = next->Base() + next->Size();
|
addr_t startRange = next->Base() + next->Size();
|
||||||
startRange -= size + kMaxRandomize;
|
startRange -= size + kMaxRandomize;
|
||||||
startRange = ROUNDDOWN(startRange, alignment);
|
startRange = ROUNDDOWN(startRange, alignment);
|
||||||
|
|
||||||
startRange = std::max(startRange, alignedNextBase);
|
startRange = std::max(startRange, alignedNextBase);
|
||||||
|
|
||||||
addr_t rangeEnd
|
addr_t rangeEnd
|
||||||
|
|||||||
Reference in New Issue
Block a user