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)
This commit is contained in:
parent
9cd890e9b7
commit
380b2f4fea
1 changed files with 3 additions and 3 deletions
|
|
@ -536,7 +536,7 @@ TEST_P(MergeStressTest, RandomMerge) {
|
||||||
ASSERT_TRUE(fence.isValid());
|
ASSERT_TRUE(fence.isValid());
|
||||||
|
|
||||||
unordered_map<int, int> fenceMap;
|
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.
|
// Randomly create syncpoints out of a fixed set of timelines, and merge them together.
|
||||||
for (int i = 0; i < mergeCount; i++) {
|
for (int i = 0; i < mergeCount; i++) {
|
||||||
|
|
@ -549,12 +549,12 @@ TEST_P(MergeStressTest, RandomMerge) {
|
||||||
// Keep track of the latest syncpoint in each timeline.
|
// Keep track of the latest syncpoint in each timeline.
|
||||||
auto itr = fenceMap.find(timelineOffset);
|
auto itr = fenceMap.find(timelineOffset);
|
||||||
if (itr == end(fenceMap)) {
|
if (itr == end(fenceMap)) {
|
||||||
fenceMap.insert(tie(timelineOffset, syncPoint));
|
fenceMap.insert(make_pair(timelineOffset, syncPoint));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int oldSyncPoint = itr->second;
|
int oldSyncPoint = itr->second;
|
||||||
fenceMap.erase(itr);
|
fenceMap.erase(itr);
|
||||||
fenceMap.insert(tie(timelineOffset, max(syncPoint, oldSyncPoint)));
|
fenceMap.insert(make_pair(timelineOffset, max(syncPoint, oldSyncPoint)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge.
|
// Merge.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue