Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
06c9784a
Commit
06c9784a
authored
Sep 24, 2011
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_memalign(): osx 10.5 doesn't have posix_memalign()
parent
3388e6b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
include/vlc_common.h
include/vlc_common.h
+24
-0
No files found.
include/vlc_common.h
View file @
06c9784a
...
...
@@ -886,10 +886,34 @@ static inline void SetQWLE (void *p, uint64_t qw)
VLC_API
bool
vlc_ureduce
(
unsigned
*
,
unsigned
*
,
uint64_t
,
uint64_t
,
uint64_t
);
/* Aligned memory allocator */
#ifdef __APPLE__
#include <AvailabilityMacros.h>
#endif
#ifdef WIN32
# include <malloc.h>
# define vlc_memalign(align, size) (__mingw_aligned_malloc(size, align))
# define vlc_free(base) (__mingw_aligned_free(base))
#elif defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
static
inline
void
*
vlc_memalign
(
size_t
align
,
size_t
size
)
{
long
diff
;
void
*
ptr
;
ptr
=
malloc
(
size
+
align
);
if
(
!
ptr
)
return
ptr
;
diff
=
((
-
(
long
)
ptr
-
1
)
&
(
align
-
1
))
+
1
;
ptr
=
(
char
*
)
ptr
+
diff
;
((
char
*
)
ptr
)[
-
1
]
=
diff
;
return
ptr
;
}
static
void
vlc_free
(
void
*
ptr
)
{
if
(
ptr
)
free
((
char
*
)
ptr
-
((
char
*
)
ptr
)[
-
1
]);
}
#else
static
inline
void
*
vlc_memalign
(
size_t
align
,
size_t
size
)
{
...
...
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