Skip to content

Commit 1b251be

Browse files
committed
- use normal malloc / free as GC_malloc seems to have issues
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20279 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent deb3809 commit 1b251be

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

SimulationRuntime/c/simulation/modelinfo.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ static void convertProfileData(const char *prefix, int numFnsAndBlocks)
6767
int i;
6868
uint32_t step;
6969
double time[2];
70-
uint32_t *iarr = (uint32_t*)GC_malloc(sizeof(uint32_t)*numFnsAndBlocks);
71-
double *darr = (double*)GC_malloc(sizeof(double)*numFnsAndBlocks);
72-
char *inBinary = (char*)GC_malloc(sizeof(char)*(len + 11));
73-
char *outCsv = (char*)GC_malloc(sizeof(char)*(len + 10));
70+
uint32_t *iarr = (uint32_t*)malloc(sizeof(uint32_t)*numFnsAndBlocks);
71+
double *darr = (double*)malloc(sizeof(double)*numFnsAndBlocks);
72+
char *inBinary = (char*)malloc(sizeof(char)*(len + 11));
73+
char *outCsv = (char*)malloc(sizeof(char)*(len + 10));
7474
FILE *fin;
7575
FILE *fout;
7676
int fail = 0;
@@ -109,6 +109,10 @@ static void convertProfileData(const char *prefix, int numFnsAndBlocks)
109109
if (fail && !feof(fin)) {
110110
throwStreamPrint(NULL, "Failed to read all data from %s", inBinary);
111111
}
112+
free(iarr);
113+
free(darr);
114+
free(inBinary);
115+
free(outCsv);
112116
}
113117

114118
static void printPlotCommand(FILE *plt, const char *plotFormat, const char *title, const char *prefix, int numFnsAndBlocks, int i, int id, const char *idPrefix) {

0 commit comments

Comments
 (0)