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
85a920dd
Commit
85a920dd
authored
Oct 12, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
different fix for strict-aliasing problem
parent
c780abfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
mysys/lf_alloc-pin.c
mysys/lf_alloc-pin.c
+8
-5
No files found.
mysys/lf_alloc-pin.c
View file @
85a920dd
...
...
@@ -416,14 +416,17 @@ static void alloc_free(struct st_lf_alloc_node *first,
struct
st_lf_alloc_node
volatile
*
last
,
LF_ALLOCATOR
*
allocator
)
{
struct
st_lf_alloc_node
*
volatile
tmp
;
tmp
=
allocator
->
top
;
/*
we need a union here to access type-punned pointer reliably.
otherwise gcc -fstrict-aliasing will not see 'tmp' changed in the loop
*/
union
{
struct
st_lf_alloc_node
*
node
;
void
*
ptr
;
}
tmp
;
tmp
.
node
=
allocator
->
top
;
do
{
last
->
next
=
tmp
;
last
->
next
=
tmp
.
node
;
}
while
(
!
my_atomic_casptr
((
void
**
)(
char
*
)
&
allocator
->
top
,
(
void
**
)(
char
*
)
&
tmp
,
first
)
&&
LF_BACKOFF
);
(
void
**
)
&
tmp
.
ptr
,
first
)
&&
LF_BACKOFF
);
}
/*
...
...
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