Chromium Code Reviews| Index: runtime/vm/zone.h |
| diff --git a/runtime/vm/zone.h b/runtime/vm/zone.h |
| index 8c5677a3ccd7770ea0950321ef0f02b8bccead29..291d44f7653f12e216b7cc92d46a898d56e234e4 100644 |
| --- a/runtime/vm/zone.h |
| +++ b/runtime/vm/zone.h |
| @@ -108,6 +108,12 @@ class Zone : public StackResource { |
| // allocating new segments of memory on demand using 'new'. |
| uword Allocate(intptr_t size) { return zone_.Allocate(size); } |
| + // Allocate space for an array of 'length' elements of type T. |
| + template <typename T> |
| + T* AllocateArray(intptr_t length) { |
| + return reinterpret_cast<T*>(Allocate(length * sizeof(T))); |
| + } |
|
srdjan
2012/05/12 00:00:55
Remove this code. Do the appropriate allocation co
Kevin Millikin (Google)
2012/05/15 11:51:44
OK, but I'm not sure why. Avoiding reinterpret_ca
srdjan
2012/05/15 22:05:32
I think there is only one place that needs it, the
|
| + |
| // Allocate 'new_size' bytes of memory and copies 'old_size' bytes from |
| // 'data' into new allocated memory. Uses current zone. |
| uword Reallocate(uword data, intptr_t old_size, intptr_t new_size) { |