From 66cb00059d739a05e8165664b86fc8e254e950ba Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 30 Jul 2022 19:03:42 -0700 Subject: [PATCH] Don't bother with malloc function attribute --- include/wimlib/blob_table.h | 6 +++--- include/wimlib/compiler.h | 4 ---- include/wimlib/paths.h | 2 +- include/wimlib/util.h | 12 ++++++------ 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/wimlib/blob_table.h b/include/wimlib/blob_table.h index d16f5a24..952b6dd0 100644 --- a/include/wimlib/blob_table.h +++ b/include/wimlib/blob_table.h @@ -266,7 +266,7 @@ struct blob_descriptor { }; extern struct blob_table * -new_blob_table(size_t capacity) _malloc_attribute; +new_blob_table(size_t capacity); extern void free_blob_table(struct blob_table *table); @@ -282,10 +282,10 @@ write_blob_table_from_blob_list(struct list_head *blob_list, int write_resource_flags); extern struct blob_descriptor * -new_blob_descriptor(void) _malloc_attribute; +new_blob_descriptor(void); extern struct blob_descriptor * -clone_blob_descriptor(const struct blob_descriptor *blob) _malloc_attribute; +clone_blob_descriptor(const struct blob_descriptor *blob); extern void blob_decrement_refcnt(struct blob_descriptor *blob, struct blob_table *table); diff --git a/include/wimlib/compiler.h b/include/wimlib/compiler.h index 1d596e20..91445b2a 100644 --- a/include/wimlib/compiler.h +++ b/include/wimlib/compiler.h @@ -99,10 +99,6 @@ # define _cold_attribute #endif -/* Hint that the annotated function is malloc-like: any non-null pointer it - * returns will not alias any pointer previously in use by the program. */ -#define _malloc_attribute __attribute__((malloc)) - /* Hint that the annotated function takes a printf()-like format string and * arguments. This is currently disabled on Windows because MinGW does not * support this attribute on functions taking wide-character strings. */ diff --git a/include/wimlib/paths.h b/include/wimlib/paths.h index e6c33177..6ff7193e 100644 --- a/include/wimlib/paths.h +++ b/include/wimlib/paths.h @@ -17,7 +17,7 @@ extern void do_canonicalize_path(const tchar *in, tchar *out); extern tchar * -canonicalize_wim_path(const tchar *wim_path) _malloc_attribute; +canonicalize_wim_path(const tchar *wim_path); /* is_any_path_separator() - characters treated as path separators in WIM path * specifications and capture configuration files (the former will be translated diff --git a/include/wimlib/util.h b/include/wimlib/util.h index 12b1b120..350fbbb5 100644 --- a/include/wimlib/util.h +++ b/include/wimlib/util.h @@ -43,7 +43,7 @@ *******************/ extern void * -wimlib_malloc(size_t size) _malloc_attribute; +wimlib_malloc(size_t size); extern void wimlib_free_memory(void *p); @@ -52,24 +52,24 @@ extern void * wimlib_realloc(void *ptr, size_t size); extern void * -wimlib_calloc(size_t nmemb, size_t size) _malloc_attribute; +wimlib_calloc(size_t nmemb, size_t size); extern char * -wimlib_strdup(const char *str) _malloc_attribute; +wimlib_strdup(const char *str); #ifdef __WIN32__ extern wchar_t * -wimlib_wcsdup(const wchar_t *str) _malloc_attribute; +wimlib_wcsdup(const wchar_t *str); #endif extern void * -wimlib_aligned_malloc(size_t size, size_t alignment) _malloc_attribute; +wimlib_aligned_malloc(size_t size, size_t alignment); extern void wimlib_aligned_free(void *ptr); extern void * -memdup(const void *mem, size_t size) _malloc_attribute; +memdup(const void *mem, size_t size); #define MALLOC wimlib_malloc #define FREE wimlib_free_memory -- 2.43.0