| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 char (&ArrayLengthHelperFunction(T (&)[Size]))[Size]; | 256 char (&ArrayLengthHelperFunction(T (&)[Size]))[Size]; |
| 257 // GCC needs some help to deduce a 0 length array. | 257 // GCC needs some help to deduce a 0 length array. |
| 258 #if COMPILER(GCC) | 258 #if COMPILER(GCC) |
| 259 template <typename T> | 259 template <typename T> |
| 260 char (&ArrayLengthHelperFunction(T (&)[0]))[0]; | 260 char (&ArrayLengthHelperFunction(T (&)[0]))[0]; |
| 261 #endif | 261 #endif |
| 262 #define WTF_ARRAY_LENGTH(array) sizeof(::WTF::ArrayLengthHelperFunction(array)) | 262 #define WTF_ARRAY_LENGTH(array) sizeof(::WTF::ArrayLengthHelperFunction(array)) |
| 263 | 263 |
| 264 } // namespace WTF | 264 } // namespace WTF |
| 265 | 265 |
| 266 // This version of placement new omits a 0 check. | |
| 267 enum NotNullTag { NotNull }; | |
| 268 inline void* operator new(size_t, NotNullTag, void* location) { | |
| 269 DCHECK(location); | |
| 270 return location; | |
| 271 } | |
| 272 | |
| 273 using WTF::bitwiseCast; | 266 using WTF::bitwiseCast; |
| 274 using WTF::safeCast; | 267 using WTF::safeCast; |
| 275 | 268 |
| 276 #endif // WTF_StdLibExtras_h | 269 #endif // WTF_StdLibExtras_h |
| OLD | NEW |