lldb-test ir-memory-map: Use IntervalMap::contains
authorPavel Labath <pavel@labath.sk>
Thu, 27 Dec 2018 09:32:04 +0000 (09:32 +0000)
committerPavel Labath <pavel@labath.sk>
Thu, 27 Dec 2018 09:32:04 +0000 (09:32 +0000)
commita352ed208bbf168c9d18ca4ab8360bea20e9a3a1
tree03891741f411f8b4681421d9f79d2ea9209d93d9
parent3eba3f1a133ba2581f40f4e097e2eb0cc615b190
lldb-test ir-memory-map: Use IntervalMap::contains

Summary:
Simplify the code by using the contains implementation in IntervalMap.

There is a slight change of behavior here: We now treat an allocation of
size 0, as if it was size 1. This guarantees that the returned addresses
will be unique, whereas previously we would allow the allocation
function to return the same zero-sized region multiple times, as long as
it is not null, and not in the middle of an existing interval (but the
situation when we were placing an larger interval over a zero-sized one
was not detected).

I think this behavior makes more sense, as that is pretty much the same
guarantee as offered by malloc (except that is permitted to also return
nullptr).

Reviewers: vsk

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D55761

llvm-svn: 350087
lldb/tools/lldb-test/lldb-test.cpp