| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Apple Computer, Inc. | 2 * Copyright (C) 2003 Apple Computer, Inc. |
| 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 * other provisions required by the MPL or the GPL, as the case may be. | 31 * other provisions required by the MPL or the GPL, as the case may be. |
| 32 * If you do not delete the provisions above, a recipient may use your | 32 * If you do not delete the provisions above, a recipient may use your |
| 33 * version of this file under any of the LGPL, the MPL or the GPL. | 33 * version of this file under any of the LGPL, the MPL or the GPL. |
| 34 */ | 34 */ |
| 35 | 35 |
| 36 #include "config.h" | 36 #include "config.h" |
| 37 #include "core/rendering/RenderArena.h" | 37 #include "core/rendering/RenderArena.h" |
| 38 | 38 |
| 39 #include <stdlib.h> | 39 #include <stdlib.h> |
| 40 #include <string.h> | 40 #include <string.h> |
| 41 |
| 41 #include <limits> | 42 #include <limits> |
| 42 #include <wtf/Assertions.h> | 43 |
| 43 #include <wtf/CryptographicallyRandomNumber.h> | 44 #include "wtf/Assertions.h" |
| 45 #include "wtf/CryptographicallyRandomNumber.h" |
| 44 | 46 |
| 45 #define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y)) | 47 #define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y)) |
| 46 | 48 |
| 47 #ifdef NDEBUG | 49 #ifdef NDEBUG |
| 48 static void* MaskPtr(void* p, uintptr_t mask) | 50 static void* MaskPtr(void* p, uintptr_t mask) |
| 49 { | 51 { |
| 50 return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(p) ^ mask); | 52 return reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(p) ^ mask); |
| 51 } | 53 } |
| 52 #endif | 54 #endif |
| 53 | 55 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 size = ROUNDUP(size, sizeof(void*)); | 163 size = ROUNDUP(size, sizeof(void*)); |
| 162 | 164 |
| 163 const size_t index = size >> kRecyclerShift; | 165 const size_t index = size >> kRecyclerShift; |
| 164 void* currentTop = m_recyclers[index]; | 166 void* currentTop = m_recyclers[index]; |
| 165 m_recyclers[index] = ptr; | 167 m_recyclers[index] = ptr; |
| 166 *((void**)ptr) = MaskPtr(currentTop, m_mask); | 168 *((void**)ptr) = MaskPtr(currentTop, m_mask); |
| 167 #endif | 169 #endif |
| 168 } | 170 } |
| 169 | 171 |
| 170 } // namespace WebCore | 172 } // namespace WebCore |
| OLD | NEW |