Skip to content

Commit

Permalink
- more zeroing out malloc-ed regions.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7443 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Dec 17, 2010
1 parent 6328031 commit f9fc7e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion c_runtime/simulation_init.cpp
Expand Up @@ -207,7 +207,10 @@ int simplex_initialization(long& nz,double *z)

/* Start with stepping .5 in each direction. */
for (ind=0;ind<nz;ind++)
STEP[ind]=.5;
{
STEP[ind] = 0.5;
VAR[ind] = 0.0;
}

double STOPCR,SIMP;
long IPRINT, NLOOP,IQUAD,IFAULT,MAXF;
Expand Down
6 changes: 6 additions & 0 deletions c_runtime/solver_main.cpp
Expand Up @@ -193,13 +193,19 @@ int solver_main(int argc, char** argv, double &start, double &stop, double &ste
case 2:
work_states = (double**) malloc((rungekutta_s+1)*sizeof(double*));
for (int i=0; i<rungekutta_s+1; i++)
{
work_states[i] = (double*) malloc(globalData->nStates*sizeof(double));
memset(work_states[i], 0, globalData->nStates*sizeof(double));
}
break;
// Enable inlining solvers
case 4:
work_states = (double**) malloc(inline_work_states_ndims*sizeof(double*));
for (int i=0; i<inline_work_states_ndims; i++)
{
work_states[i] = (double*) malloc(globalData->nStates*sizeof(double));
memset(work_states[i], 0, globalData->nStates*sizeof(double));
}
break;
}

Expand Down

0 comments on commit f9fc7e5

Please sign in to comment.