[Git][ghc/ghc][wip/T22206] fixit

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Sep 26 22:52:05 UTC 2022



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


Commits:
96c758af by Ben Gamari at 2022-09-26T22:52:04+00:00
fixit
- - - - -


1 changed file:

- rts/posix/OSThreads.c


Changes:

=====================================
rts/posix/OSThreads.c
=====================================
@@ -218,7 +218,7 @@ int
 createOSThread (OSThreadId* pId, char *name STG_UNUSED,
                 OSThreadProc *startProc, void *param)
 {
-  struct ThreadDesc *desc = stgMallocBytes("createOSThread", sizeof(struct ThreadDesc));
+  struct ThreadDesc *desc = stgMallocBytes(sizeof(struct ThreadDesc), "createOSThread");
   desc->startProc = startProc;
   desc->param = param;
   desc->name = name;
@@ -227,6 +227,8 @@ createOSThread (OSThreadId* pId, char *name STG_UNUSED,
   if (!result) {
     pthread_detach(*pId);
 
+  } else {
+      stgFree(desc);
   }
   return result;
 }



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/96c758af60299b38bc7cf2db2746c72598b12e92

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/96c758af60299b38bc7cf2db2746c72598b12e92
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/20220926/a1c87b06/attachment-0001.html>


More information about the ghc-commits mailing list