Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(804)

Side by Side Diff: Source/platform/heap/HeapTest.cpp

Issue 674143002: Oilpan: remove now-unused thread affinity macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 unsigned hash() { return IntHash<int>::hash(m_x); } 67 unsigned hash() { return IntHash<int>::hash(m_x); }
68 68
69 IntWrapper(int x) : m_x(x) { } 69 IntWrapper(int x) : m_x(x) { }
70 70
71 private: 71 private:
72 IntWrapper(); 72 IntWrapper();
73 int m_x; 73 int m_x;
74 }; 74 };
75 75
76 USED_FROM_MULTIPLE_THREADS(IntWrapper);
77
78 class ThreadMarker { 76 class ThreadMarker {
79 public: 77 public:
80 ThreadMarker() : m_creatingThread(reinterpret_cast<ThreadState*>(0)), m_num( 0) { } 78 ThreadMarker() : m_creatingThread(reinterpret_cast<ThreadState*>(0)), m_num( 0) { }
81 ThreadMarker(unsigned i) : m_creatingThread(ThreadState::current()), m_num(i ) { } 79 ThreadMarker(unsigned i) : m_creatingThread(ThreadState::current()), m_num(i ) { }
82 ThreadMarker(WTF::HashTableDeletedValueType deleted) : m_creatingThread(rein terpret_cast<ThreadState*>(-1)), m_num(0) { } 80 ThreadMarker(WTF::HashTableDeletedValueType deleted) : m_creatingThread(rein terpret_cast<ThreadState*>(-1)), m_num(0) { }
83 ~ThreadMarker() 81 ~ThreadMarker()
84 { 82 {
85 EXPECT_TRUE((m_creatingThread == ThreadState::current()) 83 EXPECT_TRUE((m_creatingThread == ThreadState::current())
86 || (m_creatingThread == reinterpret_cast<ThreadState*>(0)) 84 || (m_creatingThread == reinterpret_cast<ThreadState*>(0))
87 || (m_creatingThread == reinterpret_cast<ThreadState*>(-1))); 85 || (m_creatingThread == reinterpret_cast<ThreadState*>(-1)));
(...skipping 5306 matching lines...) Expand 10 before | Expand all | Expand 10 after
5394 TEST(HeapTest, NonNodeAllocatingNodeInDestructor) 5392 TEST(HeapTest, NonNodeAllocatingNodeInDestructor)
5395 { 5393 {
5396 new NonNodeAllocatingNodeInDestructor(); 5394 new NonNodeAllocatingNodeInDestructor();
5397 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); 5395 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
5398 EXPECT_EQ(10, (*NonNodeAllocatingNodeInDestructor::s_node)->value()); 5396 EXPECT_EQ(10, (*NonNodeAllocatingNodeInDestructor::s_node)->value());
5399 delete NonNodeAllocatingNodeInDestructor::s_node; 5397 delete NonNodeAllocatingNodeInDestructor::s_node;
5400 NonNodeAllocatingNodeInDestructor::s_node = 0; 5398 NonNodeAllocatingNodeInDestructor::s_node = 0;
5401 } 5399 }
5402 5400
5403 } // namespace blink 5401 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698