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
3605cead
Commit
3605cead
authored
Dec 09, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bit field
micro optimization
parent
b883f8fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
ndb/src/common/util/Bitmask.cpp
ndb/src/common/util/Bitmask.cpp
+6
-6
No files found.
ndb/src/common/util/Bitmask.cpp
View file @
3605cead
...
@@ -24,16 +24,16 @@ BitmaskImpl::getFieldImpl(const Uint32 src[],
...
@@ -24,16 +24,16 @@ BitmaskImpl::getFieldImpl(const Uint32 src[],
assert
(
shiftL
<
32
);
assert
(
shiftL
<
32
);
unsigned
shiftR
=
32
-
shiftL
;
unsigned
shiftR
=
32
-
shiftL
;
unsigned
undefined
=
shiftL
?
~
0
:
0
;
while
(
len
>=
32
)
while
(
len
>=
32
)
{
{
*
dst
++
|=
(
*
src
)
<<
shiftL
;
*
dst
++
|=
(
*
src
)
<<
shiftL
;
*
dst
=
shiftL
?
(
*
src
)
>>
shiftR
:
0
;
*
dst
=
((
*
src
++
)
>>
shiftR
)
&
undefined
;
src
++
;
len
-=
32
;
len
-=
32
;
}
}
*
dst
++
|=
(
*
src
)
<<
shiftL
;
*
dst
++
|=
(
*
src
)
<<
shiftL
;
*
dst
=
shiftL
?
((
*
src
)
>>
shiftR
)
&
((
1
<<
len
)
-
1
)
:
0
;
*
dst
=
((
*
src
)
>>
shiftR
)
&
((
1
<<
len
)
-
1
)
&
undefined
;
}
}
void
void
...
@@ -47,18 +47,18 @@ BitmaskImpl::setFieldImpl(Uint32 dst[],
...
@@ -47,18 +47,18 @@ BitmaskImpl::setFieldImpl(Uint32 dst[],
*/
*/
assert
(
shiftL
<
32
);
assert
(
shiftL
<
32
);
unsigned
shiftR
=
32
-
shiftL
;
unsigned
shiftR
=
32
-
shiftL
;
unsigned
undefined
=
shiftL
?
~
0
:
0
;
while
(
len
>=
32
)
while
(
len
>=
32
)
{
{
*
dst
=
(
*
src
++
)
>>
shiftL
;
*
dst
=
(
*
src
++
)
>>
shiftL
;
*
dst
++
|=
shiftL
?
(
*
src
)
<<
shiftR
:
0
;
*
dst
++
|=
((
*
src
)
<<
shiftR
)
&
undefined
;
len
-=
32
;
len
-=
32
;
}
}
Uint32
mask
=
((
1
<<
len
)
-
1
);
Uint32
mask
=
((
1
<<
len
)
-
1
);
*
dst
=
(
*
dst
&
~
mask
);
*
dst
=
(
*
dst
&
~
mask
);
*
dst
|=
((
*
src
++
)
>>
shiftL
)
&
mask
;
*
dst
|=
((
*
src
++
)
>>
shiftL
)
&
mask
;
*
dst
|=
shiftL
?
((
*
src
)
<<
shiftR
)
&
mask
:
0
;
*
dst
|=
((
*
src
)
<<
shiftR
)
&
mask
&
undefined
;
}
}
#else
#else
...
...
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