In several places, we create arrays of arrays ("jagged arrays") to represent Fortran-90-style multidimensional arrays. For instance, the TDyAllocate_IntegerArray_* and TDyAllocate_RealArray_* functions in private/tdymemoryimpl.h create these jagged arrays.
This is not actually what we want. In Fortran 90, a multidimensional array is stored as a contiguous block of memory. The C language actually provides this capability as well (though it seems not to be widely known or understood, especially by the C++ crowd). PR #233 introduces a set of macros for declaring variables that represent multidimensional arrays whose storage is backed by contiguous blocks of memory.
With these macros, we should replace the calls to the "jagged array" functions above with block allocations, and declare multidimensional arrays wherever they need to be accessed as such. This will simplify our memory allocation interface and provide better performance in logic that manipulates multidimensional array data.
In several places, we create arrays of arrays ("jagged arrays") to represent Fortran-90-style multidimensional arrays. For instance, the
TDyAllocate_IntegerArray_*
andTDyAllocate_RealArray_*
functions inprivate/tdymemoryimpl.h
create these jagged arrays.This is not actually what we want. In Fortran 90, a multidimensional array is stored as a contiguous block of memory. The C language actually provides this capability as well (though it seems not to be widely known or understood, especially by the C++ crowd). PR #233 introduces a set of macros for declaring variables that represent multidimensional arrays whose storage is backed by contiguous blocks of memory.
With these macros, we should replace the calls to the "jagged array" functions above with block allocations, and declare multidimensional arrays wherever they need to be accessed as such. This will simplify our memory allocation interface and provide better performance in logic that manipulates multidimensional array data.
Files in which these jagged arrays appear: