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
5f53f4b4
Commit
5f53f4b4
authored
Sep 18, 2006
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
page_align(ptr): New utility function to replace
ut_align_down(ptr, UNIV_PAGE_SIZE) calls.
parent
c6004169
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
7 deletions
+27
-7
btr/btr0cur.c
btr/btr0cur.c
+1
-1
btr/btr0pcur.c
btr/btr0pcur.c
+1
-1
include/page0page.h
include/page0page.h
+9
-0
include/page0page.ic
include/page0page.ic
+16
-5
No files found.
btr/btr0cur.c
View file @
5f53f4b4
...
@@ -1318,7 +1318,7 @@ btr_cur_update_in_place_log(
...
@@ -1318,7 +1318,7 @@ btr_cur_update_in_place_log(
mtr_t
*
mtr
)
/* in: mtr */
mtr_t
*
mtr
)
/* in: mtr */
{
{
byte
*
log_ptr
;
byte
*
log_ptr
;
page_t
*
page
=
ut_align_down
(
rec
,
UNIV_PAGE_SIZE
);
page_t
*
page
=
page_align
(
rec
);
ut_ad
(
flags
<
256
);
ut_ad
(
flags
<
256
);
ut_ad
(
!!
page_is_comp
(
page
)
==
dict_table_is_comp
(
index
->
table
));
ut_ad
(
!!
page_is_comp
(
page
)
==
dict_table_is_comp
(
index
->
table
));
...
...
btr/btr0pcur.c
View file @
5f53f4b4
...
@@ -88,7 +88,7 @@ btr_pcur_store_position(
...
@@ -88,7 +88,7 @@ btr_pcur_store_position(
page_cursor
=
btr_pcur_get_page_cur
(
cursor
);
page_cursor
=
btr_pcur_get_page_cur
(
cursor
);
rec
=
page_cur_get_rec
(
page_cursor
);
rec
=
page_cur_get_rec
(
page_cursor
);
page
=
ut_align_down
(
rec
,
UNIV_PAGE_SIZE
);
page
=
page_align
(
rec
);
offs
=
ut_align_offset
(
rec
,
UNIV_PAGE_SIZE
);
offs
=
ut_align_offset
(
rec
,
UNIV_PAGE_SIZE
);
ut_ad
(
mtr_memo_contains
(
mtr
,
buf_block_align
(
page
),
ut_ad
(
mtr_memo_contains
(
mtr
,
buf_block_align
(
page
),
...
...
include/page0page.h
View file @
5f53f4b4
...
@@ -132,6 +132,15 @@ directory. */
...
@@ -132,6 +132,15 @@ directory. */
#define PAGE_DIR_SLOT_MAX_N_OWNED 8
#define PAGE_DIR_SLOT_MAX_N_OWNED 8
#define PAGE_DIR_SLOT_MIN_N_OWNED 4
#define PAGE_DIR_SLOT_MIN_N_OWNED 4
/****************************************************************
Gets the start of a page. */
UNIV_INLINE
page_t
*
page_align
(
/*=======*/
/* out: start of the page */
void
*
ptr
)
/* in: pointer to page frame */
__attribute__
((
const
));
/*****************************************************************
/*****************************************************************
Returns the max trx id field value. */
Returns the max trx id field value. */
UNIV_INLINE
UNIV_INLINE
...
...
include/page0page.ic
View file @
5f53f4b4
...
@@ -15,6 +15,17 @@ Created 2/2/1994 Heikki Tuuri
...
@@ -15,6 +15,17 @@ Created 2/2/1994 Heikki Tuuri
#define UNIV_INLINE
#define UNIV_INLINE
#endif
#endif
/****************************************************************
Gets the start of a page. */
UNIV_INLINE
page_t*
page_align(
/*=======*/
/* out: start of the page */
void* ptr) /* in: pointer to page frame */
{
return((page_t*) ut_align_down(ptr, UNIV_PAGE_SIZE));
}
/*****************************************************************
/*****************************************************************
Returns the max trx id field value. */
Returns the max trx id field value. */
UNIV_INLINE
UNIV_INLINE
...
@@ -175,7 +186,7 @@ page_rec_is_comp(
...
@@ -175,7 +186,7 @@ page_rec_is_comp(
/* out: nonzero if in compact format */
/* out: nonzero if in compact format */
const rec_t* rec) /* in: record */
const rec_t* rec) /* in: record */
{
{
return(page_is_comp(
ut_align_down((rec_t*) rec, UNIV_PAGE_SIZE
)));
return(page_is_comp(
page_align((rec_t*) rec
)));
}
}
/****************************************************************
/****************************************************************
...
@@ -550,7 +561,7 @@ page_rec_get_next(
...
@@ -550,7 +561,7 @@ page_rec_get_next(
ut_ad(page_rec_check(rec));
ut_ad(page_rec_check(rec));
page =
ut_align_down(rec, UNIV_PAGE_SIZE
);
page =
page_align(rec
);
offs = rec_get_next_offs(rec, page_is_comp(page));
offs = rec_get_next_offs(rec, page_is_comp(page));
...
@@ -592,11 +603,11 @@ page_rec_set_next(
...
@@ -592,11 +603,11 @@ page_rec_set_next(
ut_ad(page_rec_check(rec));
ut_ad(page_rec_check(rec));
ut_ad(!page_rec_is_supremum(rec));
ut_ad(!page_rec_is_supremum(rec));
page =
ut_align_down(rec, UNIV_PAGE_SIZE
);
page =
page_align(rec
);
if (next) {
if (next) {
ut_ad(!page_rec_is_infimum(next));
ut_ad(!page_rec_is_infimum(next));
ut_ad(page ==
ut_align_down(next, UNIV_PAGE_SIZE
));
ut_ad(page ==
page_align(next
));
offs = (ulint) (next - page);
offs = (ulint) (next - page);
} else {
} else {
offs = 0;
offs = 0;
...
@@ -623,7 +634,7 @@ page_rec_get_prev(
...
@@ -623,7 +634,7 @@ page_rec_get_prev(
ut_ad(page_rec_check(rec));
ut_ad(page_rec_check(rec));
page =
ut_align_down(rec, UNIV_PAGE_SIZE
);
page =
page_align(rec
);
ut_ad(!page_rec_is_infimum(rec));
ut_ad(!page_rec_is_infimum(rec));
...
...
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