aboutsummaryrefslogtreecommitdiff
path: root/vpx_mem
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2015-04-16 12:29:01 -0700
committerJames Zern <jzern@google.com>2015-04-20 20:52:32 -0700
commit02804821cceb24f4294a7bd9f7576885d7de4b7a (patch)
tree80619398ded61ee6b4d7b7daa070e4cac968b5c6 /vpx_mem
parente5eda53e3d42c3b14b6b7705bc9cf95d27eb74f0 (diff)
downloadlibvpx-02804821cceb24f4294a7bd9f7576885d7de4b7a.tar.gz
vpx_mem: remove 'mem checks'
vestigial. there are tools better suited for this Change-Id: I1d6f604452fbc62cb7523eec8d1f8a72a276d6b5
Diffstat (limited to 'vpx_mem')
-rw-r--r--vpx_mem/include/vpx_mem_intrnl.h5
-rw-r--r--vpx_mem/vpx_mem.c82
-rw-r--r--vpx_mem/vpx_mem.h16
3 files changed, 5 insertions, 98 deletions
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