Declare alloc_array on demand