[Git][ghc/ghc][wip/T22965] rts: Correctly align Capability allocations

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Feb 13 20:24:18 UTC 2023



Ben Gamari pushed to branch wip/T22965 at Glasgow Haskell Compiler / GHC


Commits:
1aaefa1e by Ben Gamari at 2023-02-13T15:23:59-05:00
rts: Correctly align Capability allocations

Previously we failed to tell the C allocator that `Capability`s needed
to be aligned, resulting in #22965.

Fixes #22965.
Fixes #22975.

- - - - -


1 changed file:

- rts/Capability.c


Changes:

=====================================
rts/Capability.c
=====================================
@@ -438,8 +438,9 @@ moreCapabilities (uint32_t from USED_IF_THREADS, uint32_t to USED_IF_THREADS)
     {
         for (uint32_t i = 0; i < to; i++) {
             if (i >= from) {
-                capabilities[i] = stgMallocBytes(sizeof(Capability),
-                                                     "moreCapabilities");
+                capabilities[i] = stgMallocAlignedBytes(sizeof(Capability),
+                                                        CAPABILITY_ALIGNMENT,
+                                                        "moreCapabilities");
                 initCapability(capabilities[i], i);
             }
         }



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1aaefa1e24ffafaabb4df01b9e3ae2ea2a9257e9

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1aaefa1e24ffafaabb4df01b9e3ae2ea2a9257e9
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230213/397024d3/attachment.html>


More information about the ghc-commits mailing list