Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
97a0501e
Commit
97a0501e
authored
Jun 28, 2008
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for a strict aliasing issue with gcc 3.4.3 on sol10-amd64-a
parent
38d024b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
storage/maria/trnman.c
storage/maria/trnman.c
+11
-4
No files found.
storage/maria/trnman.c
View file @
97a0501e
...
...
@@ -519,17 +519,24 @@ my_bool trnman_end_trn(TRN *trn, my_bool commit)
*/
void
trnman_free_trn
(
TRN
*
trn
)
{
TRN
*
tmp
=
pool
;
/*
union is to solve strict aliasing issue.
without it gcc 3.4.3 doesn't notice that updating *(void **)&tmp
modifies the value of tmp.
*/
union
{
TRN
*
trn
;
void
*
v
;
}
tmp
;
tmp
.
trn
=
pool
;
my_atomic_rwlock_wrlock
(
&
LOCK_pool
);
do
{
/*
without this volatile cast gcc-3.4.4 move
d
the assignment
without this volatile cast gcc-3.4.4 move
s
the assignment
down after the loop at -O2
*/
*
(
TRN
*
volatile
*
)
&
(
trn
->
next
)
=
tmp
;
}
while
(
!
my_atomic_casptr
((
void
**
)
&
pool
,
(
void
**
)
&
tmp
,
trn
));
*
(
TRN
*
volatile
*
)
&
(
trn
->
next
)
=
tmp
.
trn
;
}
while
(
!
my_atomic_casptr
((
void
**
)
&
pool
,
&
tmp
.
v
,
trn
));
my_atomic_rwlock_wrunlock
(
&
LOCK_pool
);
}
...
...
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