Add __malloc_like macro to apply __malloc__ attribute to emalloc,
ecalloc and estrdup. It cannot be applied to realloc since that may return the same pointer.
This commit is contained in:
@@ -52,6 +52,15 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Hint to compiler that returned pointer is unique (malloc but not realloc). */
|
||||
#ifndef __malloc_like
|
||||
# if __GNUC_PREREQ__(2, 96)
|
||||
# define __malloc_like __attribute__((__malloc__))
|
||||
# else
|
||||
# define __malloc_like
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef __dso_public
|
||||
# ifdef HAVE_DSO_VISIBILITY
|
||||
# if defined(__GNUC__)
|
||||
|
Reference in New Issue
Block a user