Skip to content

Commit

Permalink
mps: Use gc_teb's allocation counter with HARP.
Browse files Browse the repository at this point in the history
When building with LLVM and using MPS, still need to use the
LLVM code path for the allocation counter as the gc_teb doesn't
exist within the LLVM backend.

This isn't sufficient to get allocation working as other things
still use the gc_teb, but they can be fixed in subsequent commits.
  • Loading branch information
waywardmonkeys committed Mar 11, 2023
1 parent d436f40 commit 0451a89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/lib/run-time/collector.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ BOOL WINAPI DylanBreakControlHandler(DWORD dwCtrlType)
STATIC_INLINE
void update_allocation_counter(gc_teb_t gc_teb, size_t count, void* wrapper)
{
#ifdef GC_USE_MPS
#if defined(GC_USE_MPS) && defined(OPEN_DYLAN_BACKEND_HARP)
gc_teb->gc_teb_allocation_counter += count;
#elif defined(OPEN_DYLAN_BACKEND_LLVM)
extern __thread DSINT Pallocation_count;
Expand Down Expand Up @@ -553,7 +553,7 @@ void update_allocation_counter(gc_teb_t gc_teb, size_t count, void* wrapper)

static void zero_allocation_counter(gc_teb_t gc_teb)
{
#ifdef GC_USE_MPS
#if defined(GC_USE_MPS) && defined(OPEN_DYLAN_BACKEND_HARP)
gc_teb->gc_teb_allocation_counter = 0;
#else
unused(gc_teb);
Expand Down

0 comments on commit 0451a89

Please sign in to comment.