added __attribute__((__malloc__)) for gcc and clang

This commit is contained in:
zimoch committed 2025-11-28 11:53:07 +01:00
1 parent 324ce2471f
commit eec358d70a
4 files changed
+17 -2

No files matched your search

+3 -2
View File
@@ -67,7 +67,7 @@ void cantProceed(
* Will never return NULL otherwise.
*/
LIBCOM_API void * callocMustSucceed(size_t count, size_t size,
const char *errorMessage);
const char *errorMessage) EPICS_MALLOC;
/** \brief A malloc() which suspends on error.
* \param size Size of block to allocate.
* \param errorMessage Context added to logged error message
@@ -76,7 +76,8 @@ LIBCOM_API void * callocMustSucceed(size_t count, size_t size,
* Will always return NULL for a zero length allocation.
* Will never return NULL otherwise.
*/
LIBCOM_API void * mallocMustSucceed(size_t size, const char *errorMessage);
LIBCOM_API void * mallocMustSucceed(size_t size, const char *errorMessage)
EPICS_MALLOC;
/** @} */
#ifdef __cplusplus