diff options
author | Aliaksey Kandratsenka <alkondratenko@gmail.com> | 2017-06-03 15:31:06 -0700 |
---|---|---|
committer | Aliaksey Kandratsenka <alkondratenko@gmail.com> | 2018-02-25 15:24:17 -0800 |
commit | 06c9414ec423ffe442c047b2560555f9d5847b1d (patch) | |
tree | abb093226d40c8a61ff8b818a135387c9225d17a /src/tests/tcmalloc_unittest.cc | |
parent | a42e44738a330783781541411392ba27df88b8b3 (diff) | |
download | gperftools-06c9414ec423ffe442c047b2560555f9d5847b1d.tar.gz |
Implemented O(log n) searching among large spans
This is implemented via std::set with custom STL allocator that
delegates to PageHeapAllocator. Free large spans are not linked
together via linked list, but inserted into std::set. Spans also store
iterators to std::set positions pointing to them. So that removing
span from set is fast too.
Patch implemented by Aliaksey Kandratsenka and Todd Lipcon based on
earlier research and experimentation by James Golick.
Addresses issue #535
[alkondratenko@gmail.com: added Todd's fix for building on OSX]
[alkondratenko@gmail.com: removed unnecessary Span constructor]
[alkondratenko@gmail.com: added const for SpanSet comparator]
[alkondratenko@gmail.com: added operator != for STLPageHeapAllocator]
Diffstat (limited to 'src/tests/tcmalloc_unittest.cc')
-rw-r--r-- | src/tests/tcmalloc_unittest.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tests/tcmalloc_unittest.cc b/src/tests/tcmalloc_unittest.cc index 25b2e41..a9c6429 100644 --- a/src/tests/tcmalloc_unittest.cc +++ b/src/tests/tcmalloc_unittest.cc @@ -1422,7 +1422,7 @@ static int RunAllTests(int argc, char** argv) { // Try strdup(), which the system allocates but we must free. If // all goes well, libc will use our malloc! - p2 = strdup("test"); + p2 = strdup("in memory of James Golick"); CHECK(p2 != NULL); VerifyNewHookWasCalled(); free(p2); |