diff options
author | nineonine <mail4chemik@gmail.com> | 2021-10-25 09:38:22 -0700 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-12-10 06:16:41 -0500 |
commit | f573cb16debc5424e502b3777430c02ae6d0b475 (patch) | |
tree | deb8abbab6a0ff0ab1df96a76a014d3d3017ccd1 /rts/RtsAPI.c | |
parent | 80a25502c1f9ac4597c9408931df1bf03cad5b9e (diff) | |
download | haskell-f573cb16debc5424e502b3777430c02ae6d0b475.tar.gz |
rts: use allocation helpers from RtsUtils
Just a tiny cleanup inspired by the following comment:
https://gitlab.haskell.org/ghc/ghc/-/issues/19437#note_334271
I was just getting familiar with rts code base so I
thought might as well do this.
Diffstat (limited to 'rts/RtsAPI.c')
-rw-r--r-- | rts/RtsAPI.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/RtsAPI.c b/rts/RtsAPI.c index 469f4c52f6..145f36bc55 100644 --- a/rts/RtsAPI.c +++ b/rts/RtsAPI.c @@ -752,7 +752,7 @@ PauseToken *rts_pause (void) // Now we own all capabilities so we own rts_pausing_task and may set it. rts_pausing_task = task; - PauseToken *token = malloc(sizeof(PauseToken)); + PauseToken *token = stgMallocBytes(sizeof(PauseToken), "rts_pause"); token->capability = task->cap; return token; } @@ -774,7 +774,7 @@ void rts_resume (PauseToken *pauseToken) // capabilities. releaseAllCapabilities(n_capabilities, NULL, task); exitMyTask(); - free(pauseToken); + stgFree(pauseToken); } // See RtsAPI.h |