Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 380b2f4f authored by mtezych's avatar mtezych Committed by Greg Hackmann
Browse files

libsync: Replace inserting tuple into unordered_map in favour of pair.

Inserting tuple into unordered_map relies on non standard libc++ extension:
http://stackoverflow.com/a/21313229
This change removes this dependency.

Test: sync-unit-tests (on hikey with SW_SYNC_USER built into kernel)
parent 9cd890e9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -536,7 +536,7 @@ TEST_P(MergeStressTest, RandomMerge) {
    ASSERT_TRUE(fence.isValid());

    unordered_map<int, int> fenceMap;
    fenceMap.insert(make_tuple(0, 0));
    fenceMap.insert(make_pair(0, 0));

    // Randomly create syncpoints out of a fixed set of timelines, and merge them together.
    for (int i = 0; i < mergeCount; i++) {
@@ -549,12 +549,12 @@ TEST_P(MergeStressTest, RandomMerge) {
        // Keep track of the latest syncpoint in each timeline.
        auto itr = fenceMap.find(timelineOffset);
        if (itr == end(fenceMap)) {
            fenceMap.insert(tie(timelineOffset, syncPoint));
            fenceMap.insert(make_pair(timelineOffset, syncPoint));
        }
        else {
            int oldSyncPoint = itr->second;
            fenceMap.erase(itr);
            fenceMap.insert(tie(timelineOffset, max(syncPoint, oldSyncPoint)));
            fenceMap.insert(make_pair(timelineOffset, max(syncPoint, oldSyncPoint)));
        }

        // Merge.