diff --git a/include/h_malloc.h b/include/h_malloc.h index f04d3cd..50001e5 100644 --- a/include/h_malloc.h +++ b/include/h_malloc.h @@ -48,11 +48,10 @@ extern "C" { #endif // C standard -__attribute__((alloc_size(1))) void *h_malloc(size_t size); -__attribute__((alloc_size(1, 2))) void *h_calloc(size_t nmemb, size_t size); +__attribute__((malloc)) __attribute__((alloc_size(1))) void *h_malloc(size_t size); +__attribute__((malloc)) __attribute__((alloc_size(1, 2))) void *h_calloc(size_t nmemb, size_t size); __attribute__((alloc_size(2))) void *h_realloc(void *ptr, size_t size); -__attribute__((alloc_align(1))) -__attribute__((alloc_size(2))) +__attribute__((malloc)) __attribute__((alloc_size(2))) __attribute__((alloc_align(1))) void *h_aligned_alloc(size_t alignment, size_t size); void h_free(void *ptr); @@ -78,12 +77,11 @@ int h_malloc_info(int options, FILE *fp); #endif // obsolete glibc extensions -__attribute__((alloc_align(1))) -__attribute__((alloc_size(2))) +__attribute__((malloc)) __attribute__((alloc_size(2))) __attribute__((alloc_align(1))) void *h_memalign(size_t alignment, size_t size); #ifndef __ANDROID__ -void *h_valloc(size_t size); -void *h_pvalloc(size_t size); +__attribute__((malloc)) void *h_valloc(size_t size); +__attribute__((malloc)) void *h_pvalloc(size_t size); #endif #ifdef __GLIBC__ void h_cfree(void *ptr) __THROW;