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
ee2b2dc7
Commit
ee2b2dc7
authored
Mar 16, 2009
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: UT_LIST_VALIDATE(): Add the parameter ASSERTION and
adjust all callers.
parent
48070b53
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
39 deletions
+57
-39
buf/buf0buddy.c
buf/buf0buddy.c
+9
-3
buf/buf0buf.c
buf/buf0buf.c
+2
-1
buf/buf0flu.c
buf/buf0flu.c
+4
-2
buf/buf0lru.c
buf/buf0lru.c
+7
-3
fil/fil0fil.c
fil/fil0fil.c
+4
-2
include/ut0lst.h
include/ut0lst.h
+29
-27
mem/mem0pool.c
mem/mem0pool.c
+2
-1
No files found.
buf/buf0buddy.c
View file @
ee2b2dc7
...
...
@@ -136,7 +136,9 @@ buf_buddy_alloc_zip(
#if defined UNIV_DEBUG && !defined UNIV_DEBUG_VALGRIND
/* Valgrind would complain about accessing free memory. */
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
zip_free
[
i
]);
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
zip_free
[
i
],
ut_a
(
buf_page_get_state
(
ut_list_node_313
)
==
BUF_BLOCK_ZIP_FREE
));
#endif
/* UNIV_DEBUG && !UNIV_DEBUG_VALGRIND */
bpage
=
UT_LIST_GET_FIRST
(
buf_pool
->
zip_free
[
i
]);
...
...
@@ -264,7 +266,9 @@ buf_buddy_alloc_from(
bpage
->
state
=
BUF_BLOCK_ZIP_FREE
;
#if defined UNIV_DEBUG && !defined UNIV_DEBUG_VALGRIND
/* Valgrind would complain about accessing free memory. */
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
zip_free
[
j
]);
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
zip_free
[
j
],
ut_a
(
buf_page_get_state
(
ut_list_node_313
)
==
BUF_BLOCK_ZIP_FREE
));
#endif
/* UNIV_DEBUG && !UNIV_DEBUG_VALGRIND */
buf_buddy_add_to_free
(
bpage
,
j
);
}
...
...
@@ -573,7 +577,9 @@ buddy_free2:
#ifndef UNIV_DEBUG_VALGRIND
buddy_nonfree:
/* Valgrind would complain about accessing free memory. */
ut_d
(
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
zip_free
[
i
]));
ut_d
(
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
zip_free
[
i
],
ut_a
(
buf_page_get_state
(
ut_list_node_313
)
==
BUF_BLOCK_ZIP_FREE
)));
#endif
/* UNIV_DEBUG_VALGRIND */
/* The buddy is not free. Is there a free block of this size? */
...
...
buf/buf0buf.c
View file @
ee2b2dc7
...
...
@@ -1155,7 +1155,8 @@ buf_relocate(
#endif
/* UNIV_LRU_DEBUG */
}
ut_d
(
UT_LIST_VALIDATE
(
LRU
,
buf_page_t
,
buf_pool
->
LRU
));
ut_d
(
UT_LIST_VALIDATE
(
LRU
,
buf_page_t
,
buf_pool
->
LRU
,
ut_ad
(
ut_list_node_313
->
in_LRU_list
)));
/* relocate buf_pool->page_hash */
fold
=
buf_page_address_fold
(
bpage
->
space
,
bpage
->
offset
);
...
...
buf/buf0flu.c
View file @
ee2b2dc7
...
...
@@ -227,7 +227,8 @@ buf_flush_remove(
bpage
->
oldest_modification
=
0
;
ut_d
(
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
flush_list
));
ut_d
(
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
flush_list
,
ut_ad
(
ut_list_node_313
->
in_flush_list
)));
}
/************************************************************************
...
...
@@ -1206,7 +1207,8 @@ buf_flush_validate_low(void)
{
buf_page_t
*
bpage
;
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
flush_list
);
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
flush_list
,
ut_ad
(
ut_list_node_313
->
in_flush_list
));
bpage
=
UT_LIST_GET_FIRST
(
buf_pool
->
flush_list
);
...
...
buf/buf0lru.c
View file @
ee2b2dc7
...
...
@@ -1908,7 +1908,8 @@ buf_LRU_validate(void)
ut_a
(
old_len
<=
new_len
+
BUF_LRU_OLD_TOLERANCE
);
}
UT_LIST_VALIDATE
(
LRU
,
buf_page_t
,
buf_pool
->
LRU
);
UT_LIST_VALIDATE
(
LRU
,
buf_page_t
,
buf_pool
->
LRU
,
ut_ad
(
ut_list_node_313
->
in_LRU_list
));
bpage
=
UT_LIST_GET_FIRST
(
buf_pool
->
LRU
);
...
...
@@ -1956,7 +1957,8 @@ buf_LRU_validate(void)
ut_a
(
buf_pool
->
LRU_old_len
==
old_len
);
}
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
free
);
UT_LIST_VALIDATE
(
list
,
buf_page_t
,
buf_pool
->
free
,
ut_ad
(
ut_list_node_313
->
in_free_list
));
for
(
bpage
=
UT_LIST_GET_FIRST
(
buf_pool
->
free
);
bpage
!=
NULL
;
...
...
@@ -1965,7 +1967,9 @@ buf_LRU_validate(void)
ut_a
(
buf_page_get_state
(
bpage
)
==
BUF_BLOCK_NOT_USED
);
}
UT_LIST_VALIDATE
(
unzip_LRU
,
buf_block_t
,
buf_pool
->
unzip_LRU
);
UT_LIST_VALIDATE
(
unzip_LRU
,
buf_block_t
,
buf_pool
->
unzip_LRU
,
ut_ad
(
ut_list_node_313
->
in_unzip_LRU_list
&&
ut_list_node_313
->
page
.
in_LRU_list
));
for
(
block
=
UT_LIST_GET_FIRST
(
buf_pool
->
unzip_LRU
);
block
;
...
...
fil/fil0fil.c
View file @
ee2b2dc7
...
...
@@ -4693,7 +4693,9 @@ fil_validate(void)
space
=
HASH_GET_FIRST
(
system
->
spaces
,
i
);
while
(
space
!=
NULL
)
{
UT_LIST_VALIDATE
(
chain
,
fil_node_t
,
space
->
chain
);
UT_LIST_VALIDATE
(
chain
,
fil_node_t
,
space
->
chain
,
ut_a
(
ut_list_node_313
->
open
||
!
ut_list_node_313
->
n_pending
));
fil_node
=
UT_LIST_GET_FIRST
(
space
->
chain
);
...
...
@@ -4713,7 +4715,7 @@ fil_validate(void)
ut_a
(
system
->
n_open
==
n_open
);
UT_LIST_VALIDATE
(
LRU
,
fil_node_t
,
system
->
LRU
);
UT_LIST_VALIDATE
(
LRU
,
fil_node_t
,
system
->
LRU
,
(
void
)
0
);
fil_node
=
UT_LIST_GET_FIRST
(
system
->
LRU
);
...
...
include/ut0lst.h
View file @
ee2b2dc7
...
...
@@ -210,34 +210,36 @@ if the list is empty. BASE is the base node (not a pointer to it). */
/************************************************************************
Checks the consistency of a two-way list. NAME is the name of the list,
TYPE is the node type, and BASE is the base node (not a pointer to it). */
#define UT_LIST_VALIDATE(NAME, TYPE, BASE)\
{\
ulint ut_list_i_313;\
TYPE * ut_list_node_313;\
\
ut_list_node_313 = (BASE).start;\
\
for (ut_list_i_313 = 0; ut_list_i_313 < (BASE).count;\
ut_list_i_313++) {\
ut_a(ut_list_node_313);\
ut_list_node_313 = (ut_list_node_313->NAME).next;\
}\
\
ut_a(ut_list_node_313 == NULL);\
\
ut_list_node_313 = (BASE).end;\
\
for (ut_list_i_313 = 0; ut_list_i_313 < (BASE).count;\
ut_list_i_313++) {\
ut_a(ut_list_node_313);\
ut_list_node_313 = (ut_list_node_313->NAME).prev;\
}\
\
ut_a(ut_list_node_313 == NULL);\
}\
TYPE is the node type, BASE is the base node (not a pointer to it),
and ASSERTION is a condition on ut_list_node_313. */
#define UT_LIST_VALIDATE(NAME, TYPE, BASE, ASSERTION) \
do { \
ulint ut_list_i_313; \
TYPE * ut_list_node_313; \
\
ut_list_node_313 = (BASE).start; \
\
for (ut_list_i_313 = 0; ut_list_i_313 < (BASE).count; \
ut_list_i_313++) { \
ut_a(ut_list_node_313); \
ASSERTION; \
ut_list_node_313 = (ut_list_node_313->NAME).next; \
} \
\
ut_a(ut_list_node_313 == NULL); \
\
ut_list_node_313 = (BASE).end; \
\
for (ut_list_i_313 = 0; ut_list_i_313 < (BASE).count; \
ut_list_i_313++) { \
ut_a(ut_list_node_313); \
ASSERTION; \
ut_list_node_313 = (ut_list_node_313->NAME).prev; \
} \
\
ut_a(ut_list_node_313 == NULL); \
} while (0)
#endif
mem/mem0pool.c
View file @
ee2b2dc7
...
...
@@ -624,7 +624,8 @@ mem_pool_validate(
for
(
i
=
0
;
i
<
64
;
i
++
)
{
UT_LIST_VALIDATE
(
free_list
,
mem_area_t
,
pool
->
free_list
[
i
]);
UT_LIST_VALIDATE
(
free_list
,
mem_area_t
,
pool
->
free_list
[
i
],
(
void
)
0
);
area
=
UT_LIST_GET_FIRST
(
pool
->
free_list
[
i
]);
...
...
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