From 41e1f748171fe3f06f2fb85a5e26541491308d4e Mon Sep 17 00:00:00 2001 From: Nicolas Trangez Date: Sun, 30 Oct 2022 20:36:47 +0100 Subject: rts: introduce (and use) `STG_MALLOC` Instead of using `GNUC3_ATTRIBUTE(__malloc__)`, provide a `STG_MALLOC` macro definition and use it instead. --- rts/RtsUtils.h | 4 ++-- rts/include/Stg.h | 2 ++ 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 -------------------------------------------------------------------------- */ -- cgit v1.2.1