| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 private: \ | 78 private: \ |
| 79 __attribute__((annotate("blink_stack_allocated"))) \ | 79 __attribute__((annotate("blink_stack_allocated"))) \ |
| 80 void* operator new(size_t) = delete; \ | 80 void* operator new(size_t) = delete; \ |
| 81 void* operator new(size_t, NotNullTag, void*) = delete; \ | 81 void* operator new(size_t, NotNullTag, void*) = delete; \ |
| 82 void* operator new(size_t, void*) = delete; | 82 void* operator new(size_t, void*) = delete; |
| 83 | 83 |
| 84 #else | 84 #else |
| 85 #define STACK_ALLOCATED() DISALLOW_ALLOCATION() | 85 #define STACK_ALLOCATED() DISALLOW_ALLOCATION() |
| 86 #endif | 86 #endif |
| 87 | 87 |
| 88 namespace blink { | |
| 89 | |
| 90 class Visitor { | |
| 91 public: | |
| 92 template<typename T> | |
| 93 void trace(const T* t) | |
| 94 { | |
| 95 } | |
| 96 template<typename T> | |
| 97 void trace(T* t) | |
| 98 { | |
| 99 } | |
| 100 template<typename T> | |
| 101 void trace(const T& t) | |
| 102 { | |
| 103 } | |
| 104 }; | |
| 105 | |
| 106 #define DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) \ | 88 #define DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) \ |
| 107 public: \ | 89 public: \ |
| 108 ~type(); \ | 90 ~type(); \ |
| 109 private: | 91 private: |
| 110 #define DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(type) \ | 92 #define DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(type) \ |
| 111 public: \ | 93 public: \ |
| 112 virtual ~type(); \ | 94 virtual ~type(); \ |
| 113 private: | 95 private: |
| 114 | 96 |
| 115 #define DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) \ | 97 #define DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) \ |
| 116 type::~type() { } | 98 type::~type() { } |
| 117 | 99 |
| 118 #define DEFINE_STATIC_REF_WILL_BE_PERSISTENT(type, name, arguments) \ | 100 #define DEFINE_STATIC_REF_WILL_BE_PERSISTENT(type, name, arguments) \ |
| 119 DEFINE_STATIC_REF(type, name, arguments) | 101 DEFINE_STATIC_REF(type, name, arguments) |
| 120 | 102 |
| 121 } // namespace blink | |
| 122 | |
| 123 #endif | 103 #endif |
| OLD | NEW |