diff options
author | hawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2003-05-14 08:58:18 +0000 |
---|---|---|
committer | hawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2003-05-14 08:58:18 +0000 |
commit | 7e9dff2f70bd9950b27092e816f9a3cc14ff3582 (patch) | |
tree | 4d5e9dd17648ac5de65e4ebeff717d3a687d71bd /src/SetTime.c | |
parent | a8a298c10ae5a5c6fdb5ed57ae9af34c563abf2e (diff) |
Change the previous_times array to be a malloc (can't use run time constants as array sizes...).
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@11 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
Diffstat (limited to 'src/SetTime.c')
-rw-r--r-- | src/SetTime.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/SetTime.c b/src/SetTime.c index 78af11b..71d2f61 100644 --- a/src/SetTime.c +++ b/src/SetTime.c @@ -109,9 +109,15 @@ int MoL_ResetTime(CCTK_ARGUMENTS) DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; - CCTK_REAL previous_times[MoL_Intermediate_Steps]; + CCTK_REAL *previous_times; CCTK_INT alphaindex, i, j; + previous_times = (CCTK_REAL*)malloc(MoL_Intermediate_Steps*sizeof(CCTK_REAL)); + if (!previous_times) + { + CCTK_WARN(0,"Failed to allocate memory for very small array!"); + } + if (*MoL_Intermediate_Step == 0) { cctkGH->cctk_time = (*Original_Time); @@ -163,6 +169,9 @@ int MoL_ResetTime(CCTK_ARGUMENTS) cctkGH->CCTK_DELTA_TIME); #endif + free(previous_times); + previous_times = NULL; + return 0; } |