summaryrefslogtreecommitdiff
path: root/rts/RtsUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'rts/RtsUtils.h')
-rw-r--r--rts/RtsUtils.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/rts/RtsUtils.h b/rts/RtsUtils.h
index d3618d6435..5282be2035 100644
--- a/rts/RtsUtils.h
+++ b/rts/RtsUtils.h
@@ -17,18 +17,25 @@
void initAllocator(void);
void shutdownAllocator(void);
+void stgFree(void* p);
+
void *stgMallocBytes(size_t n, char *msg)
- STG_MALLOC;
+ STG_MALLOC STG_MALLOC1(stgFree);
-void *stgReallocBytes(void *p, size_t n, char *msg);
+void *stgReallocBytes(void *p, size_t n, char *msg)
+ STG_MALLOC1(stgFree);
+/* Note: `stgRallocBytes` can *not* be tagged as `STG_MALLOC`
+ * since its return value *can* alias an existing pointer (i.e.,
+ * the given pointer `p`).
+ * See the documentation of the `malloc` attribute in the GCC manual
+ * for more information.
+ */
void *stgCallocBytes(size_t count, size_t size, char *msg)
- STG_MALLOC;
+ STG_MALLOC STG_MALLOC1(stgFree);
char *stgStrndup(const char *s, size_t n);
-void stgFree(void* p);
-
/* -----------------------------------------------------------------------------
* Misc other utilities
* -------------------------------------------------------------------------- */