diff options
author | Johann <johannkoenig@google.com> | 2015-04-22 13:09:47 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2015-04-22 13:09:47 -0700 |
commit | 4a29474c83289fe275ea17c887321353cca5e81a (patch) | |
tree | a902dbf5e6a6af318450fb4755232eff901af2d7 | |
parent | 9ed0e071fe83b2cbe70967cb75392ed2c23c826e (diff) | |
parent | 02804821cceb24f4294a7bd9f7576885d7de4b7a (diff) | |
download | libvpx-4a29474c83289fe275ea17c887321353cca5e81a.tar libvpx-4a29474c83289fe275ea17c887321353cca5e81a.tar.gz libvpx-4a29474c83289fe275ea17c887321353cca5e81a.tar.bz2 libvpx-4a29474c83289fe275ea17c887321353cca5e81a.zip |
Merge "vpx_mem: remove 'mem checks'"
-rwxr-xr-x | configure | 1 | ||||
-rw-r--r-- | vpx_mem/include/vpx_mem_intrnl.h | 5 | ||||
-rw-r--r-- | vpx_mem/vpx_mem.c | 82 | ||||
-rw-r--r-- | vpx_mem/vpx_mem.h | 16 |
4 files changed, 5 insertions, 99 deletions
@@ -297,7 +297,6 @@ CONFIG_LIST=" debug_libs fast_unaligned mem_tracker - mem_checks dequant_tokens dc_recon diff --git a/vpx_mem/include/vpx_mem_intrnl.h b/vpx_mem/include/vpx_mem_intrnl.h index a3da79340..b5762cf5a 100644 --- a/vpx_mem/include/vpx_mem_intrnl.h +++ b/vpx_mem/include/vpx_mem_intrnl.h @@ -17,11 +17,6 @@ # define CONFIG_MEM_TRACKER 1 /*include xvpx_* calls in the lib*/ #endif -#ifndef CONFIG_MEM_CHECKS -# define CONFIG_MEM_CHECKS 0 /*include some basic safety checks in -vpx_memcpy, _memset, and _memmove*/ -#endif - #ifndef USE_GLOBAL_FUNCTION_POINTERS # define USE_GLOBAL_FUNCTION_POINTERS 0 /*use function pointers instead of compiled functions.*/ #endif diff --git a/vpx_mem/vpx_mem.c b/vpx_mem/vpx_mem.c index 3c29e5fe4..baf005c77 100644 --- a/vpx_mem/vpx_mem.c +++ b/vpx_mem/vpx_mem.c @@ -322,84 +322,16 @@ void xvpx_free(void *p_address, char *file, int line) { #endif /*CONFIG_MEM_TRACKER*/ -#if CONFIG_MEM_CHECKS -#if defined(VXWORKS) -#include <task_lib.h> /*for task_delay()*/ -/* This function is only used to get a stack trace of the player -object so we can se where we are having a problem. */ -static int get_my_tt(int task) { - tt(task); - - return 0; -} - -static void vx_sleep(int msec) { - int ticks_to_sleep = 0; - - if (msec) { - int msec_per_tick = 1000 / sys_clk_rate_get(); - - if (msec < msec_per_tick) - ticks_to_sleep++; - else - ticks_to_sleep = msec / msec_per_tick; - } - - task_delay(ticks_to_sleep); -} -#endif -#endif - void *vpx_memcpy(void *dest, const void *source, size_t length) { -#if CONFIG_MEM_CHECKS - - if (((int)dest < 0x4000) || ((int)source < 0x4000)) { - _P(printf("WARNING: vpx_memcpy dest:0x%x source:0x%x len:%d\n", (int)dest, (int)source, length);) - -#if defined(VXWORKS) - sp(get_my_tt, task_id_self(), 0, 0, 0, 0, 0, 0, 0, 0); - - vx_sleep(10000); -#endif - } - -#endif - return VPX_MEMCPY_L(dest, source, length); } void *vpx_memset(void *dest, int val, size_t length) { -#if CONFIG_MEM_CHECKS - - if ((int)dest < 0x4000) { - _P(printf("WARNING: vpx_memset dest:0x%x val:%d len:%d\n", (int)dest, val, length);) - -#if defined(VXWORKS) - sp(get_my_tt, task_id_self(), 0, 0, 0, 0, 0, 0, 0, 0); - - vx_sleep(10000); -#endif - } - -#endif - return VPX_MEMSET_L(dest, val, length); } #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH void *vpx_memset16(void *dest, int val, size_t length) { -#if CONFIG_MEM_CHECKS - if ((int)dest < 0x4000) { - _P(printf("WARNING: vpx_memset dest:0x%x val:%d len:%d\n", - (int)dest, val, length);) - -#if defined(VXWORKS) - sp(get_my_tt, task_id_self(), 0, 0, 0, 0, 0, 0, 0, 0); - - vx_sleep(10000); -#endif - } -#endif int i; void *orig = dest; uint16_t *dest16 = dest; @@ -410,20 +342,6 @@ void *vpx_memset16(void *dest, int val, size_t length) { #endif // CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH void *vpx_memmove(void *dest, const void *src, size_t count) { -#if CONFIG_MEM_CHECKS - - if (((int)dest < 0x4000) || ((int)src < 0x4000)) { - _P(printf("WARNING: vpx_memmove dest:0x%x src:0x%x count:%d\n", (int)dest, (int)src, count);) - -#if defined(VXWORKS) - sp(get_my_tt, task_id_self(), 0, 0, 0, 0, 0, 0, 0, 0); - - vx_sleep(10000); -#endif - } - -#endif - return VPX_MEMMOVE_L(dest, src, count); } diff --git a/vpx_mem/vpx_mem.h b/vpx_mem/vpx_mem.h index 909873edd..fa9660f5d 100644 --- a/vpx_mem/vpx_mem.h +++ b/vpx_mem/vpx_mem.h @@ -29,10 +29,6 @@ #ifndef VPX_TRACK_MEM_USAGE # define VPX_TRACK_MEM_USAGE 0 /* enable memory tracking/integrity checks */ #endif -#ifndef VPX_CHECK_MEM_FUNCTIONS -# define VPX_CHECK_MEM_FUNCTIONS 0 /* enable basic safety checks in _memcpy, -_memset, and _memmove */ -#endif #ifndef REPLACE_BUILTIN_FUNCTIONS # define REPLACE_BUILTIN_FUNCTIONS 0 /* replace builtin functions with their vpx_ equivalents */ @@ -144,13 +140,11 @@ extern "C" { # endif #endif -#if !VPX_CHECK_MEM_FUNCTIONS -# ifndef __VPX_MEM_C__ -# include <string.h> -# define vpx_memcpy memcpy -# define vpx_memset memset -# define vpx_memmove memmove -# endif +#ifndef __VPX_MEM_C__ +# include <string.h> +# define vpx_memcpy memcpy +# define vpx_memset memset +# define vpx_memmove memmove #endif #ifdef VPX_MEM_PLTFRM |