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
6e57e23b
Commit
6e57e23b
authored
Mar 12, 2004
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InnoDB: remove redundant functions mach_write() and mach_read()
parent
9287264b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
63 deletions
+6
-63
innobase/include/mach0data.h
innobase/include/mach0data.h
+0
-19
innobase/include/mach0data.ic
innobase/include/mach0data.ic
+0
-38
innobase/mem/mem0dbg.c
innobase/mem/mem0dbg.c
+6
-6
No files found.
innobase/include/mach0data.h
View file @
6e57e23b
...
...
@@ -88,25 +88,6 @@ mach_read_from_4(
/*=============*/
/* out: ulint integer */
byte
*
b
);
/* in: pointer to four bytes */
/***********************************************************
The following function is used to store data from a ulint to memory
in standard order:
we store the most significant byte to the lowest address. */
UNIV_INLINE
void
mach_write
(
/*=======*/
byte
*
b
,
/* in: pointer to sizeof(ulint) bytes where to store */
ulint
n
);
/* in: ulint integer to be stored */
/************************************************************
The following function is used to fetch data from memory to a ulint.
The most significant byte is at the lowest address. */
UNIV_INLINE
ulint
mach_read
(
/*======*/
/* out: ulint integer */
byte
*
b
);
/* in: pointer to sizeof(ulint) bytes */
/*************************************************************
Writes a ulint in a compressed form. */
UNIV_INLINE
...
...
innobase/include/mach0data.ic
View file @
6e57e23b
...
...
@@ -167,44 +167,6 @@ mach_read_from_4(
#endif
}
/***********************************************************
The following function is used to store data from a ulint to memory
in standard order: we store the most significant byte to the lowest
address. */
UNIV_INLINE
void
mach_write(
/*=======*/
byte* b, /* in: pointer to 4 bytes where to store */
ulint n) /* in: ulint integer to be stored */
{
ut_ad(b);
b[0] = (byte)(n >> 24);
b[1] = (byte)(n >> 16);
b[2] = (byte)(n >> 8);
b[3] = (byte)n;
}
/************************************************************
The following function is used to fetch data from memory to a ulint.
The most significant byte is at the lowest address. */
UNIV_INLINE
ulint
mach_read(
/*======*/
/* out: ulint integer */
byte* b) /* in: pointer to 4 bytes */
{
ut_ad(b);
return( ((ulint)(b[0]) << 24)
+ ((ulint)(b[1]) << 16)
+ ((ulint)(b[2]) << 8)
+ (ulint)(b[3])
);
}
/*************************************************************
Writes a ulint in a compressed form where the first byte codes the
length of the stored ulint. We look at the most significant bits of
...
...
innobase/mem/mem0dbg.c
View file @
6e57e23b
...
...
@@ -73,37 +73,37 @@ mem_field_header_set_len(byte* field, ulint len)
{
ut_ad
(
len
>=
0
);
mach_write
(
field
-
2
*
sizeof
(
ulint
),
len
);
mach_write
_to_4
(
field
-
2
*
sizeof
(
ulint
),
len
);
}
ulint
mem_field_header_get_len
(
byte
*
field
)
{
return
(
mach_read
(
field
-
2
*
sizeof
(
ulint
)));
return
(
mach_read
_from_4
(
field
-
2
*
sizeof
(
ulint
)));
}
void
mem_field_header_set_check
(
byte
*
field
,
ulint
check
)
{
mach_write
(
field
-
sizeof
(
ulint
),
check
);
mach_write
_to_4
(
field
-
sizeof
(
ulint
),
check
);
}
ulint
mem_field_header_get_check
(
byte
*
field
)
{
return
(
mach_read
(
field
-
sizeof
(
ulint
)));
return
(
mach_read
_from_4
(
field
-
sizeof
(
ulint
)));
}
void
mem_field_trailer_set_check
(
byte
*
field
,
ulint
check
)
{
mach_write
(
field
+
mem_field_header_get_len
(
field
),
check
);
mach_write
_to_4
(
field
+
mem_field_header_get_len
(
field
),
check
);
}
ulint
mem_field_trailer_get_check
(
byte
*
field
)
{
return
(
mach_read
(
field
+
return
(
mach_read
_from_4
(
field
+
mem_field_header_get_len
(
field
)));
}
...
...
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