Skip to content

Commit

Permalink
- add the global root for boehm gc also
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14100 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Nov 28, 2012
1 parent fcb75cc commit 0b5acc8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions SimulationRuntime/c/meta/gc/marksweep.c
Expand Up @@ -590,6 +590,10 @@ void *mmc_alloc_words(unsigned nwords)
#define LARGE_CONFIG 1
#include <gc.h>

static mmc_GC_state_type x_mmc_GC_state;
mmc_GC_state_type *mmc_GC_state = &x_mmc_GC_state;
mmc_GC_local_state_type dummy_local_GC_state = 0;

/* primary allocation routine for MetaModelica */
void *mmc_alloc_words(unsigned nwords)
{
Expand All @@ -598,6 +602,10 @@ void *mmc_alloc_words(unsigned nwords)

#else /* NO GC */

static mmc_GC_state_type x_mmc_GC_state;
mmc_GC_state_type *mmc_GC_state = &x_mmc_GC_state;
mmc_GC_local_state_type dummy_local_GC_state = 0;

void *mmc_alloc_bytes(unsigned nbytes)
{
static char *mmc_cur_malloc_buf = NULL;
Expand Down Expand Up @@ -626,10 +634,6 @@ void *mmc_alloc_bytes(unsigned nbytes)
return p;
}

static mmc_GC_state_type x_mmc_GC_state;
mmc_GC_state_type *mmc_GC_state = &x_mmc_GC_state;
mmc_GC_local_state_type dummy_local_GC_state = 0;

/* primary allocation routine for MetaModelica */
void *mmc_alloc_words(unsigned nwords)
{
Expand Down

0 comments on commit 0b5acc8

Please sign in to comment.