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

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

Issue 2050463003: Check if Member owner thread matches pointer thread and current thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 4 months 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
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 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after
2421 EXPECT_TRUE(initialObjectPayloadSize == heap.objectPayloadSizeForTesting()); 2421 EXPECT_TRUE(initialObjectPayloadSize == heap.objectPayloadSizeForTesting());
2422 EXPECT_TRUE(initialAllocatedSpace == heap.heapStats().allocatedSpace()); 2422 EXPECT_TRUE(initialAllocatedSpace == heap.heapStats().allocatedSpace());
2423 EXPECT_EQ(11, IntWrapper::s_destructorCalls); 2423 EXPECT_EQ(11, IntWrapper::s_destructorCalls);
2424 EXPECT_EQ(11, LargeHeapObject::s_destructorCalls); 2424 EXPECT_EQ(11, LargeHeapObject::s_destructorCalls);
2425 preciselyCollectGarbage(); 2425 preciselyCollectGarbage();
2426 } 2426 }
2427 2427
2428 TEST(HeapTest, LargeHashMap) 2428 TEST(HeapTest, LargeHashMap)
2429 { 2429 {
2430 clearOutOldGarbage(); 2430 clearOutOldGarbage();
2431 2431 size_t size = (1 << 27) / sizeof(Member<IntWrapper>);
2432 size_t size = (1 << 27) / sizeof(int);
2433 Persistent<HeapHashMap<int, Member<IntWrapper>>> map = new HeapHashMap<int, Member<IntWrapper>>(); 2432 Persistent<HeapHashMap<int, Member<IntWrapper>>> map = new HeapHashMap<int, Member<IntWrapper>>();
2434 map->reserveCapacityForSize(size); 2433 map->reserveCapacityForSize(size);
2435 EXPECT_LE(size, map->capacity()); 2434 EXPECT_LE(size, map->capacity());
2436 } 2435 }
2437 2436
2438 TEST(HeapTest, LargeVector) 2437 TEST(HeapTest, LargeVector)
2439 { 2438 {
2440 clearOutOldGarbage(); 2439 clearOutOldGarbage();
2441 2440
2442 size_t size = (1 << 27) / sizeof(int); 2441 size_t size = (1 << 27) / sizeof(int);
(...skipping 4503 matching lines...) Expand 10 before | Expand all | Expand 10 after
6946 static_assert(WTF::IsGarbageCollectedType<HeapLinkedHashSet<Member<IntWrappe r>>>::value, "HeapLinkedHashSet"); 6945 static_assert(WTF::IsGarbageCollectedType<HeapLinkedHashSet<Member<IntWrappe r>>>::value, "HeapLinkedHashSet");
6947 static_assert(WTF::IsGarbageCollectedType<HeapListHashSet<Member<IntWrapper> >>::value, "HeapListHashSet"); 6946 static_assert(WTF::IsGarbageCollectedType<HeapListHashSet<Member<IntWrapper> >>::value, "HeapListHashSet");
6948 static_assert(WTF::IsGarbageCollectedType<HeapHashCountedSet<Member<IntWrapp er>>>::value, "HeapHashCountedSet"); 6947 static_assert(WTF::IsGarbageCollectedType<HeapHashCountedSet<Member<IntWrapp er>>>::value, "HeapHashCountedSet");
6949 static_assert(WTF::IsGarbageCollectedType<HeapHashMap<int, Member<IntWrapper >>>::value, "HeapHashMap"); 6948 static_assert(WTF::IsGarbageCollectedType<HeapHashMap<int, Member<IntWrapper >>>::value, "HeapHashMap");
6950 static_assert(WTF::IsGarbageCollectedType<HeapVector<Member<IntWrapper>>>::v alue, "HeapVector"); 6949 static_assert(WTF::IsGarbageCollectedType<HeapVector<Member<IntWrapper>>>::v alue, "HeapVector");
6951 static_assert(WTF::IsGarbageCollectedType<HeapDeque<Member<IntWrapper>>>::va lue, "HeapDeque"); 6950 static_assert(WTF::IsGarbageCollectedType<HeapDeque<Member<IntWrapper>>>::va lue, "HeapDeque");
6952 static_assert(WTF::IsGarbageCollectedType<HeapTerminatedArray<Member<IntWrap per>>>::value, "HeapTerminatedArray"); 6951 static_assert(WTF::IsGarbageCollectedType<HeapTerminatedArray<Member<IntWrap per>>>::value, "HeapTerminatedArray");
6953 } 6952 }
6954 6953
6955 } // namespace blink 6954 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/platform/heap/Member.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698