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

Side by Side Diff: third_party/WebKit/Source/platform/SharedBuffer.cpp

Issue 1474213002: [PartitionAlloc] Annotate common Blink types for heap profiling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ctti
Patch Set: Mark template specialisations as WTF_EXPORT Created 5 years 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) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return position / SharedBuffer::kSegmentSize; 48 return position / SharedBuffer::kSegmentSize;
49 } 49 }
50 50
51 static inline unsigned offsetInSegment(unsigned position) 51 static inline unsigned offsetInSegment(unsigned position)
52 { 52 {
53 return position % SharedBuffer::kSegmentSize; 53 return position % SharedBuffer::kSegmentSize;
54 } 54 }
55 55
56 static inline char* allocateSegment() 56 static inline char* allocateSegment()
57 { 57 {
58 return static_cast<char*>(WTF::Partitions::fastMalloc(SharedBuffer::kSegment Size, WTF_HEAP_PROFILER_TYPE_NAME(SharedBuffer))); 58 return static_cast<char*>(WTF::Partitions::fastMalloc(SharedBuffer::kSegment Size, "blink::SharedBuffer"));
59 } 59 }
60 60
61 static inline void freeSegment(char* p) 61 static inline void freeSegment(char* p)
62 { 62 {
63 WTF::Partitions::fastFree(p); 63 WTF::Partitions::fastFree(p);
64 } 64 }
65 65
66 #ifdef SHARED_BUFFER_STATS 66 #ifdef SHARED_BUFFER_STATS
67 67
68 static Mutex& statsMutex() 68 static Mutex& statsMutex()
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 // If there is data in the segments, then it should have been allocated 423 // If there is data in the segments, then it should have been allocated
424 // using fastMalloc. 424 // using fastMalloc.
425 const String dataDumpName = dumpPrefix + "/segments"; 425 const String dataDumpName = dumpPrefix + "/segments";
426 auto dump = memoryDump->createMemoryAllocatorDump(dataDumpName); 426 auto dump = memoryDump->createMemoryAllocatorDump(dataDumpName);
427 dump->addScalar("size", "bytes", m_size); 427 dump->addScalar("size", "bytes", m_size);
428 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllo catedObjectPoolName)); 428 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllo catedObjectPoolName));
429 } 429 }
430 } 430 }
431 431
432 } // namespace blink 432 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | third_party/WebKit/Source/platform/heap/Handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698