Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
4fb311c8
Commit
4fb311c8
authored
Mar 24, 2016
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop memalign hack
It no longer serves a useful purpose.
parent
f01f7a78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
33 deletions
+3
-33
configure
configure
+0
-7
mem.c
libavutil/mem.c
+3
-26
No files found.
configure
View file @
4fb311c8
...
...
@@ -294,7 +294,6 @@ Advanced options (experts only):
--disable-safe-bitstream-reader
disable buffer boundary checking in bitreaders
(faster, but may crash)
--enable-memalign-hack emulate memalign, interferes with memory debuggers
--enable-sram allow use of on-chip SRAM
Optimization options (experts only):
...
...
@@ -1354,7 +1353,6 @@ CONFIG_LIST="
$LIBRARY_LIST
$PROGRAM_LIST
$SUBSYSTEM_LIST
memalign_hack
neon_clobber_test
pic
pod2man
...
...
@@ -1471,7 +1469,6 @@ ARCH_FEATURES="
local_aligned_8
local_aligned_16
local_aligned_32
simd_align
simd_align_16
simd_align_32
"
...
...
@@ -1884,7 +1881,6 @@ aligned_stack_if_any="aarch64 ppc x86"
fast_64bit_if_any
=
"aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
fast_clz_if_any
=
"aarch64 alpha avr32 mips ppc x86"
fast_unaligned_if_any
=
"aarch64 ppc x86"
simd_align_if_any
=
"simd_align_16 simd_align_32"
simd_align_16_if_any
=
"altivec neon sse"
simd_align_32_if_any
=
"avx"
...
...
@@ -5041,9 +5037,6 @@ enabled_all dxva2 CoTaskMemFree &&
prepend avconv_libs
$(
$ldflags_filter
"-lole32"
)
&&
enable
dxva2_lib
!
enabled_any memalign posix_memalign aligned_malloc
&&
enabled simd_align
&&
enable
memalign_hack
map
'enabled $v && intrinsics=${v#intrinsics_}'
$INTRINSICS_LIST
for
thread
in
$THREADS_LIST
;
do
...
...
libavutil/mem.c
View file @
4fb311c8
...
...
@@ -62,22 +62,12 @@ void free(void *ptr);
void
*
av_malloc
(
size_t
size
)
{
void
*
ptr
=
NULL
;
#if CONFIG_MEMALIGN_HACK
long
diff
;
#endif
/* let's disallow possibly ambiguous cases */
if
(
size
>
(
INT_MAX
-
32
)
||
!
size
)
return
NULL
;
#if CONFIG_MEMALIGN_HACK
ptr
=
malloc
(
size
+
32
);
if
(
!
ptr
)
return
ptr
;
diff
=
((
-
(
long
)
ptr
-
1
)
&
31
)
+
1
;
ptr
=
(
char
*
)
ptr
+
diff
;
((
char
*
)
ptr
)[
-
1
]
=
diff
;
#elif HAVE_POSIX_MEMALIGN
#if HAVE_POSIX_MEMALIGN
if
(
posix_memalign
(
&
ptr
,
32
,
size
))
ptr
=
NULL
;
#elif HAVE_ALIGNED_MALLOC
...
...
@@ -116,21 +106,11 @@ void *av_malloc(size_t size)
void
*
av_realloc
(
void
*
ptr
,
size_t
size
)
{
#if CONFIG_MEMALIGN_HACK
int
diff
;
#endif
/* let's disallow possibly ambiguous cases */
if
(
size
>
(
INT_MAX
-
16
))
return
NULL
;
#if CONFIG_MEMALIGN_HACK
//FIXME this isn't aligned correctly, though it probably isn't needed
if
(
!
ptr
)
return
av_malloc
(
size
);
diff
=
((
char
*
)
ptr
)[
-
1
];
return
(
char
*
)
realloc
((
char
*
)
ptr
-
diff
,
size
+
diff
)
+
diff
;
#elif HAVE_ALIGNED_MALLOC
#if HAVE_ALIGNED_MALLOC
return
_aligned_realloc
(
ptr
,
size
,
32
);
#else
return
realloc
(
ptr
,
size
);
...
...
@@ -189,10 +169,7 @@ int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
void
av_free
(
void
*
ptr
)
{
#if CONFIG_MEMALIGN_HACK
if
(
ptr
)
free
((
char
*
)
ptr
-
((
char
*
)
ptr
)[
-
1
]);
#elif HAVE_ALIGNED_MALLOC
#if HAVE_ALIGNED_MALLOC
_aligned_free
(
ptr
);
#else
free
(
ptr
);
...
...
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