diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-11-09 12:39:47 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-12-16 16:12:44 -0500 |
commit | 70999283156f527c5aea6dee57a3d14989a9903a (patch) | |
tree | 50a7d056523d831e4df2202911b78ebb5c92a9af /rts/ProfHeap.c | |
parent | 99269b9fd817262a686867383bf0fe88fdc64fb0 (diff) | |
download | haskell-70999283156f527c5aea6dee57a3d14989a9903a.tar.gz |
rts: Introduce getNumCapabilities
And ensure accesses to n_capabilities are atomic (although with relaxed
ordering). This is necessary as RTS API callers may concurrently call
into the RTS without holding a capability.
Diffstat (limited to 'rts/ProfHeap.c')
-rw-r--r-- | rts/ProfHeap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 41c8ab2508..288c5c8a54 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -1314,7 +1314,7 @@ void heapCensus (Time t) heapCensusChain( census, generations[g].large_objects ); heapCensusCompactList ( census, generations[g].compact_objects ); - for (n = 0; n < n_capabilities; n++) { + for (n = 0; n < getNumCapabilities(); n++) { ws = &gc_threads[n]->gens[g]; heapCensusChain(census, ws->todo_bd); heapCensusChain(census, ws->part_list); |