Skip to content

Commit

Permalink
- cleanup MetaModelica GC interface, remove obsolete files
Browse files Browse the repository at this point in the history
- use alloc atomic whenever possible
- use alloc ignore off page for array allocation as they are quite big
- register pointer displacement (0) and if RML_STYLE_TAGPTR is defined register pointer displacement (3) also


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19728 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Mar 25, 2014
1 parent 7049f60 commit 46bac05
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 3,428 deletions.
4 changes: 2 additions & 2 deletions Compiler/Template/CodegenC.tpl
Expand Up @@ -5535,7 +5535,7 @@ case FUNCTION(__) then
DLLExport
int in_<%fname%>(type_description * inArgs, type_description * outVar)
{
<% if acceptMetaModelicaGrammar() then "if (!mmc_GC_state) mmc_GC_init(mmc_GC_settings_default);" %>
<% if acceptMetaModelicaGrammar() then "if (!mmc_GC_state) mmc_GC_init();" %>
<%functionArguments |> var => '<%funArgDefinition(var)%>;' ;separator="\n"%>
<%if outVars then '<%retType%> out;'%>
<%functionArguments |> arg => readInVar(arg) ;separator="\n"%>
Expand Down Expand Up @@ -5882,7 +5882,7 @@ case efn as EXTERNAL_FUNCTION(__) then
DLLExport
int in_<%fname%>(type_description * inArgs, type_description * outVar)
{
<% if acceptMetaModelicaGrammar() then "if (!mmc_GC_state) mmc_GC_init(mmc_GC_settings_default);" %>
<% if acceptMetaModelicaGrammar() then "if (!mmc_GC_state) mmc_GC_init();" %>
<%funArgs |> VARIABLE(__) => '<%expTypeArrayIf(ty)%> <%contextCref(name,contextFunction)%>;' ;separator="\n"%>
<%if outVars then '<%retType%> out;'%>
<%funArgs |> arg as VARIABLE(__) => readInVar(arg) ;separator="\n"%>
Expand Down
4 changes: 4 additions & 0 deletions Compiler/runtime/systemimpl.c
Expand Up @@ -2567,6 +2567,10 @@ int SystemImpl__fileIsNewerThan(const char *file1, const char *file2)
void SystemImpl__initGarbageCollector(void)
{
GC_init();
GC_register_displacement(0);
#ifdef RML_STYLE_TAGPTR
GC_register_displacement(3);
#endif
}

int SystemImpl__fileContentsEqual(const char *file1, const char *file2)
Expand Down
6 changes: 1 addition & 5 deletions SimulationRuntime/c/Makefile.common
Expand Up @@ -54,11 +54,7 @@ RUNTIMEMETA_HEADERS = ./meta/meta_modelica_builtin_boxptr.h \
./meta/meta_modelica_segv.h \
./meta/meta_modelica_string_lit.h

RUNTIMEMETAGC_HEADERS = ./meta/gc/common.h \
./meta/gc/mmc_gc.h \
./meta/gc/generational.h \
./meta/gc/marksweep.h \
./meta/gc/roots.h
RUNTIMEMETAGC_HEADERS = ./meta/gc/mmc_gc.h

RUNTIMEUTIL_HEADERS = \
./util/base_array.h \
Expand Down
12 changes: 2 additions & 10 deletions SimulationRuntime/c/meta/CMakeLists.txt
Expand Up @@ -5,23 +5,15 @@ SET(META_SRC meta_modelica_builtin.c
meta_modelica_catch.c
meta_modelica.c
meta_modelica_segv.c
gc/mmc_gc.c
gc/common.c
gc/roots.c
gc/generational.c
gc/marksweep.c)
gc/mmc_gc.c)

SET(META_HFILES rml_compatibility.h
meta_modelica_builtin.h
meta_modelica_builtin_boxptr.h
meta_modelica_segv.h
meta_modelica_string_lit.h
meta_modelica.h
gc/mmc_gc.h
gc/common.h
gc/generational.h
gc/marksweep.h
gc/roots.h)
gc/mmc_gc.h)


# Library meta
Expand Down

0 comments on commit 46bac05

Please sign in to comment.