+ /**
+ * Allocate an array with the same dimensions as the specified value.
+ */
+ template< class T >
+ inline T *
+ alloc(const trace::Value *value) {
+ const trace::Array *array = dynamic_cast<const trace::Array *>(value);
+ if (array) {
+ return alloc<T>(array->size());
+ }
+ const trace::Null *null = dynamic_cast<const trace::Null *>(value);
+ if (null) {
+ return NULL;
+ }
+ assert(0);
+ return NULL;
+ }
+