aboutsummaryrefslogtreecommitdiff
path: root/src/nuc_eos/readtable.c
diff options
context:
space:
mode:
authorrhaas <rhaas@8e189c6b-2ab8-4400-aa02-70a9cfce18b9>2012-06-04 17:14:00 +0000
committerrhaas <rhaas@8e189c6b-2ab8-4400-aa02-70a9cfce18b9>2012-06-04 17:14:00 +0000
commitb7f6e4f941dabfa1f05b79e8ed04eef8a12638e6 (patch)
tree34323dad9997eee3912c7d669740fb5bd814e809 /src/nuc_eos/readtable.c
parentd9aa427b5c0e034591b58d5019dfd5507fd8e20b (diff)
EOS_Omni: avoid allocting temporary memory twice
instead of storing a copy of the data in the Fortran module store Fortran pointers. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEOS/EOS_Omni/trunk@62 8e189c6b-2ab8-4400-aa02-70a9cfce18b9
Diffstat (limited to 'src/nuc_eos/readtable.c')
-rw-r--r--src/nuc_eos/readtable.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/nuc_eos/readtable.c b/src/nuc_eos/readtable.c
index 5cdc229..b71229c 100644
--- a/src/nuc_eos/readtable.c
+++ b/src/nuc_eos/readtable.c
@@ -9,7 +9,7 @@
#include "cctk_Functions.h"
// Interface of function for fortran module eostable
-void CCTK_FNAME(allocate_eosmodule)
+void CCTK_FNAME(setup_eosmodule)
(CCTK_INT* , CCTK_INT* , CCTK_INT*, CCTK_REAL*,
CCTK_REAL*, CCTK_REAL*, CCTK_REAL*, CCTK_REAL*);
@@ -133,17 +133,10 @@ void EOS_OMNI_ReadTable(CCTK_ARGUMENTS)
HDF5_ERROR(H5Sclose(mem3));
HDF5_ERROR(H5Fclose(file));
- // Give all values to fortran - which will copy them until I can find out how
- // I can tell Fortran to use those pointers inside the module
- CCTK_FNAME(allocate_eosmodule)
+ // Give all values to fortran - which will store pointers to them, so don't
+ // free these arrays.
+ CCTK_FNAME(setup_eosmodule)
(&nrho, &ntemp, &nye, alltables, logrho, logtemp, ye, &energy_shift);
-
- // Free the memory again because fortran copied the whole thing now
- free(ye);
- free(logtemp);
- free(logrho);
- free(alltables);
-
}