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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
nexedi
MariaDB
Commits
0f6186c5
Commit
0f6186c5
authored
Apr 08, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make my_atomic_*lint type-safe
parent
8beeeddd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
storage/innobase/include/sync0types.h
storage/innobase/include/sync0types.h
+19
-5
No files found.
storage/innobase/include/sync0types.h
View file @
0f6186c5
...
...
@@ -1153,36 +1153,50 @@ enum rw_lock_flag_t {
#endif
/* UNIV_INNOCHECKSUM */
#ifdef _WIN64
static
inline
ulint
my_atomic_addlint
(
ulint
*
A
,
ulint
B
)
{
#ifdef _WIN64
return
ulint
(
my_atomic_add64
((
volatile
int64
*
)
A
,
B
));
#else
return
ulint
(
my_atomic_addlong
(
A
,
B
));
#endif
}
static
inline
ulint
my_atomic_loadlint
(
const
ulint
*
A
)
{
#ifdef _WIN64
return
ulint
(
my_atomic_load64
((
volatile
int64
*
)
A
));
#else
return
ulint
(
my_atomic_loadlong
(
A
));
#endif
}
static
inline
lint
my_atomic_addlint
(
volatile
lint
*
A
,
lint
B
)
{
#ifdef _WIN64
return
my_atomic_add64
((
volatile
int64
*
)
A
,
B
);
#else
return
my_atomic_addlong
(
A
,
B
);
#endif
}
static
inline
lint
my_atomic_loadlint
(
const
lint
*
A
)
{
#ifdef _WIN64
return
lint
(
my_atomic_load64
((
volatile
int64
*
)
A
));
#else
return
my_atomic_loadlong
(
A
);
#endif
}
static
inline
void
my_atomic_storelint
(
ulint
*
A
,
ulint
B
)
{
#ifdef _WIN64
my_atomic_store64
((
volatile
int64
*
)
A
,
B
);
}
#else
#define my_atomic_addlint my_atomic_addlong
#define my_atomic_loadlint my_atomic_loadlong
#define my_atomic_storelint my_atomic_storelong
my_atomic_storelong
(
A
,
B
);
#endif
}
/** Simple counter aligned to CACHE_LINE_SIZE
@tparam Type the integer type of the counter
...
...
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