Skip to content
Snippets Groups Projects
Commit 350976f5 authored by whh8b's avatar whh8b
Browse files

Memory space bug fixes

1. A plugin that returns space smaller than "min size"
is not bad if the dollop fits within the space entirely.

2. GetNearbyFreeRanges() should really treat the parameter
as a lower bound.
parent 1644659d
No related branches found
No related tags found
No related merge requests found
......@@ -176,7 +176,7 @@ std::pair<RangeSet_t::const_iterator,RangeSet_t::const_iterator>
ZiprMemorySpace_t::GetNearbyFreeRanges(const RangeAddress_t hint,size_t count)
{
Range_t search(hint, hint+1);
RangeSet_t::const_iterator result = free_ranges.upper_bound(search);
RangeSet_t::const_iterator result = free_ranges.lower_bound(search);
/*
* TODO: Not quite sure what to make of this.
*/
......
......@@ -1429,7 +1429,8 @@ void ZiprImpl_t::PlaceDollops()
<< std::hex << placement.GetEnd()
<< endl;
if ((placement.GetEnd()-placement.GetStart()) < minimum_valid_req_size){
if ((placement.GetEnd()-placement.GetStart()) < minimum_valid_req_size &&
placement.GetEnd()-placement.GetStart() < to_place->GetSize()) {
if (m_verbose)
cout << "Bad GetNearbyFreeRange() result." << endl;
placed = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment