'Checks which segment tha the address `addr` should belong to, and, returns the offset of that segment.
Note that the address may not actually belong to the block.
:param addr: The address to search
:return: The offset of the segment.'

def _search(self, addr):

    start = 0
    end = len(self._list)
    while (start != end):
        mid = ((start + end) / 2)
        segment = self._list[mid]
        if (addr < segment.start):
            end = mid
        elif (addr >= segment.end):
            start = (mid + 1)
        else:
            start = mid
            break
    return start
