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
639baee6
Commit
639baee6
authored
Jun 24, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: remove LF_REQUIRE_PINS, use compile_time_assert() instead of reimplementing it
parent
31a1934c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5 additions
and
30 deletions
+5
-30
include/lf.h
include/lf.h
+5
-18
mysys/lf_alloc-pin.c
mysys/lf_alloc-pin.c
+0
-2
mysys/lf_hash.c
mysys/lf_hash.c
+0
-2
mysys/waiting_threads.c
mysys/waiting_threads.c
+0
-4
storage/maria/lockman.c
storage/maria/lockman.c
+0
-2
storage/maria/trnman.c
storage/maria/trnman.c
+0
-2
No files found.
include/lf.h
View file @
639baee6
...
...
@@ -131,25 +131,12 @@ typedef struct {
#define lf_rwunlock_by_pins(PINS) \
my_atomic_rwlock_wrunlock(&(PINS)->pinbox->pinarray.lock)
/*
compile-time assert, to require "no less than N" pins
it's enough if it'll fail on at least one compiler, so
we'll enable it on GCC only, which supports zero-length arrays.
*/
#if defined(__GNUC__) && defined(MY_LF_EXTRA_DEBUG)
#define LF_REQUIRE_PINS(N) \
static const char require_pins[LF_PINBOX_PINS-N] \
__attribute__ ((unused)); \
static const int LF_NUM_PINS_IN_THIS_FILE= N;
/* compile-time assert to make sure we have enough pins. */
#define _lf_pin(PINS, PIN, ADDR) \
( \
assert(PIN < LF_NUM_PINS_IN_THIS_FILE), \
my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR)) \
)
#else
#define LF_REQUIRE_PINS(N)
#define _lf_pin(PINS, PIN, ADDR) my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR))
#endif
do { \
compile_time_assert(PIN < LF_PINBOX_PINS); \
my_atomic_storeptr(&(PINS)->pin[PIN], (ADDR)); \
} while(0)
#define _lf_unpin(PINS, PIN) _lf_pin(PINS, PIN, NULL)
#define lf_pin(PINS, PIN, ADDR) \
...
...
mysys/lf_alloc-pin.c
View file @
639baee6
...
...
@@ -412,8 +412,6 @@ found:
/* lock-free memory allocator for fixed-size objects */
LF_REQUIRE_PINS
(
1
)
/*
callback for _lf_pinbox_real_free to free a list of unpinned objects -
add it back to the allocator stack
...
...
mysys/lf_hash.c
View file @
639baee6
...
...
@@ -27,8 +27,6 @@
#include <my_bit.h>
#include <lf.h>
LF_REQUIRE_PINS
(
3
)
/* An element of the list */
typedef
struct
{
intptr
volatile
link
;
/* a pointer to the next element in a listand a flag */
...
...
mysys/waiting_threads.c
View file @
639baee6
...
...
@@ -604,8 +604,6 @@ static int deadlock_search(struct deadlock_arg *arg, WT_THD *blocker,
DBUG_PRINT
(
"wt"
,
(
"enter: thd=%s, blocker=%s, depth=%u"
,
arg
->
thd
->
name
,
blocker
->
name
,
depth
));
LF_REQUIRE_PINS
(
1
);
arg
->
last_locked_rc
=
0
;
if
(
depth
>
arg
->
max_depth
)
...
...
@@ -923,8 +921,6 @@ int wt_thd_will_wait_for(WT_THD *thd, WT_THD *blocker,
WT_RESOURCE
*
rc
;
DBUG_ENTER
(
"wt_thd_will_wait_for"
);
LF_REQUIRE_PINS
(
3
);
DBUG_PRINT
(
"wt"
,
(
"enter: thd=%s, blocker=%s, resid=%lu"
,
thd
->
name
,
blocker
->
name
,
(
ulong
)
resid
->
value
));
...
...
storage/maria/lockman.c
View file @
639baee6
...
...
@@ -211,8 +211,6 @@ static enum lockman_getlock_result getlock_result[10][10]=
#undef A
#undef x
LF_REQUIRE_PINS
(
4
)
typedef
struct
lockman_lock
{
uint64
resource
;
struct
lockman_lock
*
lonext
;
...
...
storage/maria/trnman.c
View file @
639baee6
...
...
@@ -577,7 +577,6 @@ int trnman_can_read_from(TRN *trn, TrID trid)
{
TRN
**
found
;
my_bool
can
;
LF_REQUIRE_PINS
(
3
);
if
(
trid
<
trn
->
min_read_from
)
return
1
;
/* Row is visible by all transactions in the system */
...
...
@@ -618,7 +617,6 @@ int trnman_can_read_from(TRN *trn, TrID trid)
TRN
*
trnman_trid_to_trn
(
TRN
*
trn
,
TrID
trid
)
{
TRN
**
found
;
LF_REQUIRE_PINS
(
3
);
if
(
trid
<
trn
->
min_read_from
)
return
0
;
/* it's committed eons ago */
...
...
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