Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
4a29474c
Commit
4a29474c
authored
Apr 22, 2015
by
Johann
Committed by
Gerrit Code Review
Apr 22, 2015
Browse files
Merge "vpx_mem: remove 'mem checks'"
parents
9ed0e071
02804821
Changes
4
Hide whitespace changes
Inline
Side-by-side
configure
View file @
4a29474c
...
...
@@ -297,7 +297,6 @@ CONFIG_LIST="
debug_libs
fast_unaligned
mem_tracker
mem_checks
dequant_tokens
dc_recon
...
...
vpx_mem/include/vpx_mem_intrnl.h
View file @
4a29474c
...
...
@@ -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
...
...
vpx_mem/vpx_mem.c
View file @
4a29474c
...
...
@@ -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
);
}
...
...
vpx_mem/vpx_mem.h
View file @
4a29474c
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment