git.videolan.org
/
vlc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
0051f02
)
Assert proper alignment of the atomic reference counter
author
Rémi Denis-Courmont
<rdenis@simphalempin.com>
Sat, 17 Jan 2009 12:05:28 +0000
(14:05 +0200)
committer
Rémi Denis-Courmont
<rdenis@simphalempin.com>
Sat, 17 Jan 2009 12:06:41 +0000
(14:06 +0200)
src/libvlc.c
patch
|
blob
|
history
diff --git
a/src/libvlc.c
b/src/libvlc.c
index
c121244
..
c74a681
100644
(file)
--- a/
src/libvlc.c
+++ b/
src/libvlc.c
@@
-146,6
+146,7
@@
void *vlc_hold (gc_object_t * p_gc)
{
uintptr_t refs;
assert( p_gc );
+ assert ((((uintptr_t)&refs) & (sizeof (void *) - 1)) == 0); /* alignment */
#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
refs = __sync_add_and_fetch (&p_gc->refs, 1);
@@
-173,6
+174,7
@@
void vlc_release (gc_object_t *p_gc)
unsigned refs;
assert( p_gc );
+ assert ((((uintptr_t)&refs) & (sizeof (void *) - 1)) == 0); /* alignment */
#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
refs = __sync_sub_and_fetch (&p_gc->refs, 1);