Chromium Code Reviews| Index: runtime/platform/allocation.h |
| diff --git a/runtime/platform/allocation.h b/runtime/platform/allocation.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6744921f0fb0b12ac85f87094a2edd6566bab19a |
| --- /dev/null |
| +++ b/runtime/platform/allocation.h |
| @@ -0,0 +1,37 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
|
siva
2017/02/22 23:37:16
2017
rmacnak
2017/02/23 19:00:17
Done.
|
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +#ifndef RUNTIME_PLATFORM_ALLOCATION_H_ |
| +#define RUNTIME_PLATFORM_ALLOCATION_H_ |
| + |
| +#include "platform/assert.h" |
| + |
| +namespace dart { |
| + |
| +// Stack allocated objects subclass from this base class. Objects of this type |
| +// cannot be allocated on either the C or object heaps. Destructors for objects |
| +// of this type will not be run unless the stack is unwound through normal |
| +// program control flow. |
| +class ValueObject { |
| + public: |
| + ValueObject() {} |
| + ~ValueObject() {} |
| + |
| + private: |
| + DISALLOW_ALLOCATION(); |
| + DISALLOW_COPY_AND_ASSIGN(ValueObject); |
| +}; |
| + |
| + |
| +// Static allocated classes only contain static members and can never |
| +// be instantiated in the heap or on the stack. |
| +class AllStatic { |
| + private: |
| + DISALLOW_ALLOCATION(); |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(AllStatic); |
| +}; |
| + |
| +} // namespace dart |
| + |
| +#endif // RUNTIME_PLATFORM_ALLOCATION_H_ |