| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void* result = backingAllocate(size); | 81 void* result = backingAllocate(size); |
| 82 memset(result, 0, size); | 82 memset(result, 0, size); |
| 83 return reinterpret_cast<Return>(result); | 83 return reinterpret_cast<Return>(result); |
| 84 } | 84 } |
| 85 template <typename Return, typename Metadata> | 85 template <typename Return, typename Metadata> |
| 86 static Return malloc(size_t size) | 86 static Return malloc(size_t size) |
| 87 { | 87 { |
| 88 return reinterpret_cast<Return>(fastMalloc(size)); | 88 return reinterpret_cast<Return>(fastMalloc(size)); |
| 89 } | 89 } |
| 90 WTF_EXPORT static void backingFree(void* address); | 90 WTF_EXPORT static void backingFree(void* address); |
| 91 WTF_EXPORT static inline bool backingExpand(void*, size_t) |
| 92 { |
| 93 return false; |
| 94 } |
| 91 static void free(void* address) | 95 static void free(void* address) |
| 92 { | 96 { |
| 93 fastFree(address); | 97 fastFree(address); |
| 94 } | 98 } |
| 95 template<typename T> | 99 template<typename T> |
| 96 static void* newArray(size_t bytes) | 100 static void* newArray(size_t bytes) |
| 97 { | 101 { |
| 98 return malloc<void*, void>(bytes); | 102 return malloc<void*, void>(bytes); |
| 99 } | 103 } |
| 100 static void | 104 static void |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 { \ | 187 { \ |
| 184 ASSERT(location); \ | 188 ASSERT(location); \ |
| 185 return location; \ | 189 return location; \ |
| 186 } \ | 190 } \ |
| 187 private: \ | 191 private: \ |
| 188 typedef int __thisIsHereToForceASemicolonAfterThisMacro | 192 typedef int __thisIsHereToForceASemicolonAfterThisMacro |
| 189 | 193 |
| 190 using WTF::DefaultAllocator; | 194 using WTF::DefaultAllocator; |
| 191 | 195 |
| 192 #endif // WTF_DefaultAllocator_h | 196 #endif // WTF_DefaultAllocator_h |
| OLD | NEW |