summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Trangez <ikke@nicolast.be>2022-10-30 20:36:47 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-02 12:06:48 -0400
commit41e1f748171fe3f06f2fb85a5e26541491308d4e (patch)
treebf3cf556c6729dc9c7ef2dbf0e63fdb7af79d431
parent81a5843333c9121b055b13907794a8afe24cd747 (diff)
downloadhaskell-41e1f748171fe3f06f2fb85a5e26541491308d4e.tar.gz
rts: introduce (and use) `STG_MALLOC`
Instead of using `GNUC3_ATTRIBUTE(__malloc__)`, provide a `STG_MALLOC` macro definition and use it instead.
-rw-r--r--rts/RtsUtils.h4
-rw-r--r--rts/include/Stg.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/rts/RtsUtils.h b/rts/RtsUtils.h
index c87aedb3a7..d3618d6435 100644
--- a/rts/RtsUtils.h
+++ b/rts/RtsUtils.h
@@ -18,12 +18,12 @@ void initAllocator(void);
void shutdownAllocator(void);
void *stgMallocBytes(size_t n, char *msg)
- GNUC3_ATTRIBUTE(__malloc__);
+ STG_MALLOC;
void *stgReallocBytes(void *p, size_t n, char *msg);
void *stgCallocBytes(size_t count, size_t size, char *msg)
- GNUC3_ATTRIBUTE(__malloc__);
+ STG_MALLOC;
char *stgStrndup(const char *s, size_t n);
diff --git a/rts/include/Stg.h b/rts/include/Stg.h
index 8e36bf6fab..ffecd70240 100644
--- a/rts/include/Stg.h
+++ b/rts/include/Stg.h
@@ -244,6 +244,8 @@
#define STG_NORETURN GNU_ATTRIBUTE(__noreturn__)
+#define STG_MALLOC GNUC3_ATTRIBUTE(__malloc__)
+
/* -----------------------------------------------------------------------------
Global type definitions
-------------------------------------------------------------------------- */