ref: ab350c2f29c6b38c68bb365c9919fa709490f57d
parent: 23517a3e4d2aaebcd45f2afd50ad0f6df36c040c
author: Wan-Teh Chang <[email protected]>
date: Thu Apr 2 20:38:56 EDT 2020
Update a stale comment for dav1d_alloc_aligned() Also, the assertion that 'align' is a power of 2 can be used by all cases in dav1d_alloc_aligned().
--- a/include/common/mem.h
+++ b/include/common/mem.h
@@ -37,13 +37,13 @@
#include "common/attributes.h"
/*
- * Allocate 32-byte aligned memory. The return value can be released
- * by calling the standard free() function.
+ * Allocate align-byte aligned memory. The return value can be released
+ * by calling the dav1d_free_aligned() function.
*/
static inline void *dav1d_alloc_aligned(size_t sz, size_t align) {
+ assert(!(align & (align - 1)));
#ifdef HAVE_POSIX_MEMALIGN
void *ptr;
- assert(!(align & (align - 1)));
if (posix_memalign(&ptr, align, sz)) return NULL;
return ptr;
#elif defined(HAVE_ALIGNED_MALLOC)