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

Side by Side Diff: Source/wtf/BitVector.cpp

Issue 1189593003: Rename Partitions::getRenderingPartition() -> getLayoutPartition() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/wtf/ArrayBufferContents.cpp ('k') | Source/wtf/DefaultAllocator.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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 memset(outOfLineBits()->bits(), 0, byteCount(size())); 73 memset(outOfLineBits()->bits(), 0, byteCount(size()));
74 } 74 }
75 75
76 BitVector::OutOfLineBits* BitVector::OutOfLineBits::create(size_t numBits) 76 BitVector::OutOfLineBits* BitVector::OutOfLineBits::create(size_t numBits)
77 { 77 {
78 // Because of the way BitVector stores the pointer, memory tools 78 // Because of the way BitVector stores the pointer, memory tools
79 // will erroneously report a leak here. 79 // will erroneously report a leak here.
80 WTF_ANNOTATE_SCOPED_MEMORY_LEAK; 80 WTF_ANNOTATE_SCOPED_MEMORY_LEAK;
81 numBits = (numBits + bitsInPointer() - 1) & ~(bitsInPointer() - 1); 81 numBits = (numBits + bitsInPointer() - 1) & ~(bitsInPointer() - 1);
82 size_t size = sizeof(OutOfLineBits) + sizeof(uintptr_t) * (numBits / bitsInP ointer()); 82 size_t size = sizeof(OutOfLineBits) + sizeof(uintptr_t) * (numBits / bitsInP ointer());
83 void* allocation = partitionAllocGeneric(Partitions::getBufferPartition(), s ize); 83 void* allocation = partitionAllocGeneric(Partitions::bufferPartition(), size );
84 OutOfLineBits* result = new (NotNull, allocation) OutOfLineBits(numBits); 84 OutOfLineBits* result = new (NotNull, allocation) OutOfLineBits(numBits);
85 return result; 85 return result;
86 } 86 }
87 87
88 void BitVector::OutOfLineBits::destroy(OutOfLineBits* outOfLineBits) 88 void BitVector::OutOfLineBits::destroy(OutOfLineBits* outOfLineBits)
89 { 89 {
90 partitionFreeGeneric(Partitions::getBufferPartition(), outOfLineBits); 90 partitionFreeGeneric(Partitions::bufferPartition(), outOfLineBits);
91 } 91 }
92 92
93 void BitVector::resizeOutOfLine(size_t numBits) 93 void BitVector::resizeOutOfLine(size_t numBits)
94 { 94 {
95 ASSERT(numBits > maxInlineBits()); 95 ASSERT(numBits > maxInlineBits());
96 OutOfLineBits* newOutOfLineBits = OutOfLineBits::create(numBits); 96 OutOfLineBits* newOutOfLineBits = OutOfLineBits::create(numBits);
97 size_t newNumWords = newOutOfLineBits->numWords(); 97 size_t newNumWords = newOutOfLineBits->numWords();
98 if (isInline()) { 98 if (isInline()) {
99 // Make sure that all of the bits are zero in case we do a no-op resize. 99 // Make sure that all of the bits are zero in case we do a no-op resize.
100 *newOutOfLineBits->bits() = m_bitsOrPointer & ~(static_cast<uintptr_t>(1 ) << maxInlineBits()); 100 *newOutOfLineBits->bits() = m_bitsOrPointer & ~(static_cast<uintptr_t>(1 ) << maxInlineBits());
(...skipping 14 matching lines...) Expand all
115 { 115 {
116 for (size_t i = 0; i < size(); ++i) { 116 for (size_t i = 0; i < size(); ++i) {
117 if (get(i)) 117 if (get(i))
118 out.printf("1"); 118 out.printf("1");
119 else 119 else
120 out.printf("-"); 120 out.printf("-");
121 } 121 }
122 } 122 }
123 123
124 } // namespace WTF 124 } // namespace WTF
OLDNEW
« no previous file with comments | « Source/wtf/ArrayBufferContents.cpp ('k') | Source/wtf/DefaultAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698