Carl Shapiro | 1fb8620 | 2011-06-27 17:43:13 -0700 | [diff] [blame] | 1 | // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 | // Author: cshapiro@google.com (Carl Shapiro) |
| 3 | |
| 4 | #ifndef ART_SRC_HEAP_H_ |
| 5 | #define ART_SRC_HEAP_H_ |
| 6 | |
| 7 | #include "src/globals.h" |
| 8 | #include "src/object.h" |
| 9 | |
| 10 | namespace art { |
| 11 | |
| 12 | class Heap { |
| 13 | public: |
| 14 | static Class* AllocClass(size_t size) { |
| 15 | byte* raw = new byte[size]; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 16 | memset(raw, 0, size); |
Carl Shapiro | 1fb8620 | 2011-06-27 17:43:13 -0700 | [diff] [blame] | 17 | return reinterpret_cast<Class*>(raw); |
| 18 | } |
| 19 | }; |
| 20 | |
| 21 | } // namespace art |
| 22 | |
| 23 | #endif // ART_SRC_HEAP_H_ |