Skip to content

Commit

Permalink
- fix testsuite (we fixed using GC_malloc_uncollectable in one place …
Browse files Browse the repository at this point in the history
…but there were more places)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23750 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Dec 12, 2014
1 parent 7db0bbb commit f2367a9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SimulationRuntime/c/simulation/solver/dassl.c
Expand Up @@ -140,7 +140,7 @@ int dassl_initial(DATA* data, SOLVER_INFO* solverInfo, DASSL_DATA *dasslData)
/* work arrays for DASSL */
unsigned int i;
SIMULATION_INFO *simInfo = &(data->simulationInfo);
SIMULATION_DATA tmpSimData;
SIMULATION_DATA tmpSimData = {0};

TRACE_PUSH

Expand Down Expand Up @@ -197,11 +197,11 @@ int dassl_initial(DATA* data, SOLVER_INFO* solverInfo, DASSL_DATA *dasslData)
assertStreamPrint(data->threadData, 0 != tmpSimData.integerVars, "out of memory");
tmpSimData.booleanVars = (modelica_boolean*)calloc(data->modelData.nVariablesBoolean, sizeof(modelica_boolean));
assertStreamPrint(data->threadData, 0 != tmpSimData.booleanVars, "out of memory");
tmpSimData.stringVars = (modelica_string*)calloc(data->modelData.nVariablesString, sizeof(modelica_string));
tmpSimData.stringVars = (modelica_string*) GC_malloc_uncollectable(data->modelData.nVariablesString * sizeof(modelica_string));
assertStreamPrint(data->threadData, 0 != tmpSimData.stringVars, "out of memory");
appendRingData(dasslData->simulationData, &tmpSimData);
}
dasslData->localData = (SIMULATION_DATA**) calloc(SIZERINGBUFFER, sizeof(SIMULATION_DATA*));
dasslData->localData = (SIMULATION_DATA**) GC_malloc_uncollectable(SIZERINGBUFFER * sizeof(SIMULATION_DATA*));
rotateRingBuffer(dasslData->simulationData, 0, (void**) dasslData->localData);

/* end setup internal ring buffer for dassl */
Expand Down Expand Up @@ -427,9 +427,9 @@ int dassl_deinitial(DASSL_DATA *dasslData)
free(tmpSimData->realVars);
free(tmpSimData->integerVars);
free(tmpSimData->booleanVars);
free(tmpSimData->stringVars);
GC_free(tmpSimData->stringVars);
}
free(dasslData->localData);
GC_free(dasslData->localData);
freeRingBuffer(dasslData->simulationData);

free(dasslData);
Expand Down

0 comments on commit f2367a9

Please sign in to comment.