The 10.15 SDK only declares it for C++17 and C11. In Chromium, we only
call this from .cc files, and these are C++14 still for now.
The 11.0 SDK declares it independent of language version (as long as
__DARWIN_C_LEVEL >= __DARWIN_C_FULL, which it is by default, at least
on macOS).
So this calls the system version in fewer scenarios than possible,
but it keeps the preprocessor checks fairly small.
Bug: chromium:1098741
Change-Id: I1e30f88bb040876bca2b59adee0a1cff33b9ff03
I pasted this from the _aligned_malloc() branch, and _aligned_malloc()
apparently has the argments swapped compared to aligned_alloc() :/
Bug: chromium:1098741
Change-Id: Iddd92a7beb9e75ddc63b96f757457ec4258fd1ca
The 11.0 SDK adds a declaration of aligned_malloc() that's available
on macOS 10.15 and later. vulkan_memory_allocator also defines a
symbol with the same name, which causes problems.
As fix, rename the vulkan_memory_allocator version to
vma_aligned_malloc(). Use this opportunity to use the same mechanism on
Windows (a no-op), and, while here, call the system aligned_malloc()
on macOS 10.15 from there too.
Bug: chromium:1098741
Change-Id: If738a1451a08c0813532fc4b778d9118a23210b7
Closes#119
Added internal class VmaSmallVector.
Refactored common code into a new function VmaAllocator_T::GetFlushOrInvalidateRange.
Regenerated docs.
These are only present on the declarations in the C API.
New macros
- `VMA_NULLABLE`
- `VMA_NOT_NULL`
- `VMA_NULLABLE_NON_DISPATCHABLE`
- `VMA_NOT_NULL_NON_DISPATCHABLE`
- `VMA_LEN_IF_NOT_NULL`
On clang `VMA_NOT_NULL` and `VMA_NULLABLE` are defined as `_Nonnull` and
`_Nullable`. Clang will use these annotations to generate diagnostics
when these functions or structs are incorrectly used.
`VMA_NULLABLE_NON_DISPATCHABLE` and `VMA_NOT_NULL_NON_DISPATCHABLE` are
not defined on platforms where Vulkan's non-dispatchable handles are not
pointers; on platforms where they are, these macros are defined to be
`VMA_NULLABLE` and `VMA_NOT_NULL` respectively.
`LEN_IF_NOT_NULL` is not defined for any compiler. It is included to
mirror the `len` attribute in the Vulkan XML spec in order to aid in
development of other language bindings for this library.
It was tempting to use C's array syntax (`foo(int len, int arr[len])`)to
specify lengths, however this is not possible to use with optional
pointers, nor is it possible to use inside structs. For the sake of
consistency only `VMA_LEN_IF_NOT_NULL` is used (additionally neither
clang not gcc generate warnings for function misuse when the array
length specifier is anything but an integer literal).
- Also correct a couple of typos
- Also add assert on ppName in vmaGetPoolName
Closes#114