Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
1f91cdce
Commit
1f91cdce
authored
16 years ago
by
Ramiro Polla
Browse files
Options
Downloads
Patches
Plain Diff
Use posix_memalign() if available.
Originally committed as revision 16488 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
218a6022
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configure
+4
-2
4 additions, 2 deletions
configure
libavutil/mem.c
+4
-1
4 additions, 1 deletion
libavutil/mem.c
with
8 additions
and
3 deletions
configure
+
4
−
2
View file @
1f91cdce
...
@@ -866,6 +866,7 @@ HAVE_LIST="
...
@@ -866,6 +866,7 @@ HAVE_LIST="
memalign
memalign
mkstemp
mkstemp
pld
pld
posix_memalign
ppc64
ppc64
round
round
roundf
roundf
...
@@ -1819,6 +1820,7 @@ check_func getrusage
...
@@ -1819,6 +1820,7 @@ check_func getrusage
check_func inet_aton
$network_extralibs
check_func inet_aton
$network_extralibs
check_func memalign
check_func memalign
check_func mkstemp
check_func mkstemp
check_func posix_memalign
check_func_headers windows.h GetProcessTimes
check_func_headers windows.h GetProcessTimes
check_header conio.h
check_header conio.h
...
@@ -1833,8 +1835,8 @@ check_header vdpau/vdpau.h
...
@@ -1833,8 +1835,8 @@ check_header vdpau/vdpau.h
check_header vdpau/vdpau_x11.h
check_header vdpau/vdpau_x11.h
check_header X11/extensions/XvMClib.h
check_header X11/extensions/XvMClib.h
if
!
enabled_any memalign memalign_hack
&&
enabled need_memalign
;
then
if
!
enabled_any memalign memalign_hack
posix_memalign
&&
enabled need_memalign
;
then
die
"Error, no
mem
align
()
but SSE enabled, disable it or use --enable-memalign-hack."
die
"Error, no align
ed memory allocator
but SSE enabled, disable it or use --enable-memalign-hack."
fi
fi
disabled zlib
||
check_lib zlib.h zlibVersion
-lz
||
disable zlib
disabled zlib
||
check_lib zlib.h zlibVersion
-lz
||
disable zlib
...
...
This diff is collapsed.
Click to expand it.
libavutil/mem.c
+
4
−
1
View file @
1f91cdce
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#undef free
#undef free
#undef realloc
#undef realloc
#include
<stdlib.h>
#ifdef HAVE_MALLOC_H
#ifdef HAVE_MALLOC_H
#include
<malloc.h>
#include
<malloc.h>
#endif
#endif
...
@@ -41,7 +42,7 @@
...
@@ -41,7 +42,7 @@
void
*
av_malloc
(
unsigned
int
size
)
void
*
av_malloc
(
unsigned
int
size
)
{
{
void
*
ptr
;
void
*
ptr
=
NULL
;
#ifdef CONFIG_MEMALIGN_HACK
#ifdef CONFIG_MEMALIGN_HACK
long
diff
;
long
diff
;
#endif
#endif
...
@@ -57,6 +58,8 @@ void *av_malloc(unsigned int size)
...
@@ -57,6 +58,8 @@ void *av_malloc(unsigned int size)
diff
=
((
-
(
long
)
ptr
-
1
)
&
15
)
+
1
;
diff
=
((
-
(
long
)
ptr
-
1
)
&
15
)
+
1
;
ptr
=
(
char
*
)
ptr
+
diff
;
ptr
=
(
char
*
)
ptr
+
diff
;
((
char
*
)
ptr
)[
-
1
]
=
diff
;
((
char
*
)
ptr
)[
-
1
]
=
diff
;
#elif defined (HAVE_POSIX_MEMALIGN)
posix_memalign
(
&
ptr
,
16
,
size
);
#elif defined (HAVE_MEMALIGN)
#elif defined (HAVE_MEMALIGN)
ptr
=
memalign
(
16
,
size
);
ptr
=
memalign
(
16
,
size
);
/* Why 64?
/* Why 64?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment