Skip to content

Commit

Permalink
Inline mmc_mk_modelica_array for source FMUs
Browse files Browse the repository at this point in the history
This fixes ticket:4899.

Belonging to [master]:
  - OpenModelica/OMCompiler#2393
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Apr 24, 2018
1 parent 549896e commit f5e1d77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions SimulationRuntime/c/meta/meta_modelica.h
Expand Up @@ -209,8 +209,17 @@ static void* mmc_mk_rcon(double d)
#endif
return MMC_TAGPTR(p);
}
static void* mmc_mk_modelica_array(base_array_t arr)
{
base_array_t *cpy = mmc_alloc_words(sizeof(arr)/sizeof(void*) + 1);
memcpy(cpy, &arr, sizeof(base_array_t));
clone_base_array_spec(&arr, cpy);
/* Note: The data is hopefully not stack-allocated and can be passed this way */
return cpy;
}
#else
void* mmc_mk_rcon(double d);
void* mmc_mk_modelica_array(base_array_t);
#endif

#include "openmodelica.h"
Expand Down
1 change: 0 additions & 1 deletion SimulationRuntime/c/meta/meta_modelica_data.h
Expand Up @@ -229,7 +229,6 @@ typedef int mmc_switch_type;
#define mmc_mk_integer mmc_mk_icon
#define mmc_mk_boolean mmc_mk_bcon
#define mmc_mk_real mmc_mk_rcon
void* mmc_mk_modelica_array(base_array_t);

void mmc_catch_dummy_fn();

Expand Down

0 comments on commit f5e1d77

Please sign in to comment.