annotate alloc on unixes. (#548)

* annotate `alloc` on unixes.

* changes from feedback
This commit is contained in:
David CARLIER
2022-09-25 07:26:59 +01:00
committed by GitHub
parent 591dc4c77f
commit a060462ff6

View File

@@ -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