| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Paul Pedriana <ppedriana@ea.com>. All rights reserve
d. | 2 * Copyright (C) 2008, 2009 Paul Pedriana <ppedriana@ea.com>. All rights reserve
d. |
| 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // ... | 40 // ... |
| 41 // }; | 41 // }; |
| 42 // | 42 // |
| 43 // struct Data { | 43 // struct Data { |
| 44 // WTF_MAKE_FAST_ALLOCATED | 44 // WTF_MAKE_FAST_ALLOCATED |
| 45 // public: | 45 // public: |
| 46 // ... | 46 // ... |
| 47 // }; | 47 // }; |
| 48 // | 48 // |
| 49 | 49 |
| 50 #include "wtf/Assertions.h" | 50 #include "sky/engine/wtf/Assertions.h" |
| 51 #include "wtf/FastMalloc.h" | 51 #include "sky/engine/wtf/FastMalloc.h" |
| 52 #include "wtf/StdLibExtras.h" | 52 #include "sky/engine/wtf/StdLibExtras.h" |
| 53 | 53 |
| 54 #define WTF_MAKE_FAST_ALLOCATED \ | 54 #define WTF_MAKE_FAST_ALLOCATED \ |
| 55 public: \ | 55 public: \ |
| 56 void* operator new(size_t, void* p) { return p; } \ | 56 void* operator new(size_t, void* p) { return p; } \ |
| 57 void* operator new[](size_t, void* p) { return p; } \ | 57 void* operator new[](size_t, void* p) { return p; } \ |
| 58 \ | 58 \ |
| 59 void* operator new(size_t size) \ | 59 void* operator new(size_t size) \ |
| 60 { \ | 60 { \ |
| 61 return ::WTF::fastMalloc(size); \ | 61 return ::WTF::fastMalloc(size); \ |
| 62 } \ | 62 } \ |
| (...skipping 14 matching lines...) Expand all Loading... |
| 77 } \ | 77 } \ |
| 78 void* operator new(size_t, NotNullTag, void* location) \ | 78 void* operator new(size_t, NotNullTag, void* location) \ |
| 79 { \ | 79 { \ |
| 80 ASSERT(location); \ | 80 ASSERT(location); \ |
| 81 return location; \ | 81 return location; \ |
| 82 } \ | 82 } \ |
| 83 private: \ | 83 private: \ |
| 84 typedef int __thisIsHereToForceASemicolonAfterThisMacro | 84 typedef int __thisIsHereToForceASemicolonAfterThisMacro |
| 85 | 85 |
| 86 #endif // FastAllocBase_h | 86 #endif // FastAllocBase_h |
| OLD | NEW |