| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |