diff --git a/src/snmalloc/mem/localalloc.h b/src/snmalloc/mem/localalloc.h index 592625eb5..2fca90949 100644 --- a/src/snmalloc/mem/localalloc.h +++ b/src/snmalloc/mem/localalloc.h @@ -1,7 +1,9 @@ #pragma once -#ifdef _MSC_VER -# define ALLOCATOR __declspec(allocator) +#if defined(_MSC_VER) +# define ALLOCATOR __declspec(allocator) __declspec(restrict) +#elif __has_attribute(malloc) +# define ALLOCATOR __attribute__((malloc)) #else # define ALLOCATOR #endif