vpx_mem: allow VPX_MAX_ALLOCABLE_MEMORY to be overridden
authorJames Zern <jzern@google.com>
Mon, 17 Sep 2018 19:32:58 +0000 (12:32 -0700)
committerJames Zern <jzern@google.com>
Mon, 17 Sep 2018 19:41:33 +0000 (12:41 -0700)
this allows the define to be set by the build environment

Change-Id: Ib40111c5d9bae417b031b8b40a7bc135c6734044

vpx_mem/vpx_mem.c

index eeba34c..18abf11 100644 (file)
 #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.
 static int check_size_argument_overflow(uint64_t nmemb, uint64_t size) {