ref: 42e48983aa0e6f34c9643e24da7215fdbb692ef6
parent: 2945e9ebfaa1387413f61d6bdbbf2d689f4e2a10
author: James Zern <jzern@google.com>
date: Mon Sep 17 08:32:58 EDT 2018
vpx_mem: allow VPX_MAX_ALLOCABLE_MEMORY to be overridden this allows the define to be set by the build environment Change-Id: Ib40111c5d9bae417b031b8b40a7bc135c6734044
--- a/vpx_mem/vpx_mem.c
+++ b/vpx_mem/vpx_mem.c
@@ -16,11 +16,13 @@
#include "include/vpx_mem_intrnl.h"
#include "vpx/vpx_integer.h"
+#if !defined(VPX_MAX_ALLOCABLE_MEMORY)
#if SIZE_MAX > (1ULL << 40)
#define VPX_MAX_ALLOCABLE_MEMORY (1ULL << 40)
#else
// For 32-bit targets keep this below INT_MAX to avoid valgrind warnings.
#define VPX_MAX_ALLOCABLE_MEMORY ((1ULL << 31) - (1 << 16))
+#endif
#endif
// Returns 0 in case of overflow of nmemb * size.