diff options
Diffstat (limited to 'third_party/aom/aom_mem/aom_mem.h')
-rw-r--r-- | third_party/aom/aom_mem/aom_mem.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/third_party/aom/aom_mem/aom_mem.h b/third_party/aom/aom_mem/aom_mem.h index 75bd4be65..0d533c813 100644 --- a/third_party/aom/aom_mem/aom_mem.h +++ b/third_party/aom/aom_mem/aom_mem.h @@ -39,6 +39,25 @@ void *aom_memset16(void *dest, int val, size_t length); #include AOM_MEM_PLTFRM #endif +#if CONFIG_DEBUG +#define AOM_CHECK_MEM_ERROR(error_info, lval, expr) \ + do { \ + lval = (expr); \ + if (!lval) \ + aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \ + "Failed to allocate " #lval " at %s:%d", __FILE__, \ + __LINE__); \ + } while (0) +#else +#define AOM_CHECK_MEM_ERROR(error_info, lval, expr) \ + do { \ + lval = (expr); \ + if (!lval) \ + aom_internal_error(error_info, AOM_CODEC_MEM_ERROR, \ + "Failed to allocate " #lval); \ + } while (0) +#endif + #if defined(__cplusplus) } #endif |