TDycores-Project / TDycore

BSD 2-Clause "Simplified" License
4 stars 0 forks source link

Devised a new interface for allocating/freeing memory #233

Closed jeff-cohere closed 2 years ago

jeff-cohere commented 2 years ago

This PR introduces three functions (some are actually macros):

With this, we don't have to remember which of the several different functions to call to allocate or free memory. Just call the appropriate one of these three. :-)

Multidimensional Arrays

I've also added some macros to allow us to declare multidimensional arrays that are contiguous in memory, instead of the "jagged" arrays we currently create using the TDyAllocate_IntegerArray_ND functions and friends. We should definitely switch from using our jagged arrays to these contiguous multidimensional arrays, but that should be done in another PR. The macros, each of which declares a variable pointing to a multidimensional array given a slab of memory, are:

Fixes #229

codecov-commenter commented 2 years ago

Codecov Report

Merging #233 (43ebbd4) into master (e4a0200) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #233   +/-   ##
=======================================
  Coverage   51.57%   51.57%           
=======================================
  Files           4        4           
  Lines         764      764           
=======================================
  Hits          394      394           
  Misses        370      370           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e4a0200...43ebbd4. Read the comment docs.