OLD | NEW |
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 { | 187 { |
188 return (bitCount + 7) >> 3; | 188 return (bitCount + 7) >> 3; |
189 } | 189 } |
190 | 190 |
191 static uintptr_t makeInlineBits(uintptr_t bits) | 191 static uintptr_t makeInlineBits(uintptr_t bits) |
192 { | 192 { |
193 ASSERT(!(bits & (static_cast<uintptr_t>(1) << maxInlineBits()))); | 193 ASSERT(!(bits & (static_cast<uintptr_t>(1) << maxInlineBits()))); |
194 return bits | (static_cast<uintptr_t>(1) << maxInlineBits()); | 194 return bits | (static_cast<uintptr_t>(1) << maxInlineBits()); |
195 } | 195 } |
196 | 196 |
197 class OutOfLineBits { | 197 class WTF_EXPORT OutOfLineBits { |
198 public: | 198 public: |
199 size_t numBits() const { return m_numBits; } | 199 size_t numBits() const { return m_numBits; } |
200 size_t numWords() const { return (m_numBits + bitsInPointer() - 1) / bit
sInPointer(); } | 200 size_t numWords() const { return (m_numBits + bitsInPointer() - 1) / bit
sInPointer(); } |
201 uintptr_t* bits() { return bitwise_cast<uintptr_t*>(this + 1); } | 201 uintptr_t* bits() { return bitwise_cast<uintptr_t*>(this + 1); } |
202 const uintptr_t* bits() const { return bitwise_cast<const uintptr_t*>(th
is + 1); } | 202 const uintptr_t* bits() const { return bitwise_cast<const uintptr_t*>(th
is + 1); } |
203 | 203 |
204 static OutOfLineBits* create(size_t numBits); | 204 static OutOfLineBits* create(size_t numBits); |
205 | 205 |
206 static void destroy(OutOfLineBits*); | 206 static void destroy(OutOfLineBits*); |
207 | 207 |
(...skipping 29 matching lines...) Expand all Loading... |
237 } | 237 } |
238 | 238 |
239 uintptr_t m_bitsOrPointer; | 239 uintptr_t m_bitsOrPointer; |
240 }; | 240 }; |
241 | 241 |
242 } // namespace WTF | 242 } // namespace WTF |
243 | 243 |
244 using WTF::BitVector; | 244 using WTF::BitVector; |
245 | 245 |
246 #endif // BitVector_h | 246 #endif // BitVector_h |
OLD | NEW |