Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
4f24cb04
Commit
4f24cb04
authored
18 years ago
by
Ger van Diepen
Browse files
Options
Downloads
Patches
Plain Diff
BugID: 738
Make default alignment max 8
parent
544d5c5b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LCS/Blob/include/Blob/BlobField.h
+3
-1
3 additions, 1 deletion
LCS/Blob/include/Blob/BlobField.h
LCS/Blob/src/BlobField2.cc
+2
-2
2 additions, 2 deletions
LCS/Blob/src/BlobField2.cc
with
5 additions
and
3 deletions
LCS/Blob/include/Blob/BlobField.h
+
3
−
1
View file @
4f24cb04
...
@@ -158,7 +158,8 @@ namespace LOFAR {
...
@@ -158,7 +158,8 @@ namespace LOFAR {
// Return the greatest power of 2 that divides the value.
// Return the greatest power of 2 that divides the value.
// It is used to make the default alignment a power of 2.
// It is used to make the default alignment a power of 2.
static
uint
p2divider
(
uint
value
);
// It the result exceeds the maximum, it is set to the maximum.
static
uint
p2divider
(
uint
value
,
uint
maxval
=
8
);
// Helper functions for BlobFieldSet.
// Helper functions for BlobFieldSet.
// <group>
// <group>
...
@@ -237,6 +238,7 @@ namespace LOFAR {
...
@@ -237,6 +238,7 @@ namespace LOFAR {
// that is a power of 2. E.g. for an array of structs containing 3 floats,
// that is a power of 2. E.g. for an array of structs containing 3 floats,
// the element size is 12, but the basic element size is 4.
// the element size is 12, but the basic element size is 4.
// For a struct containing 2 floats the basic element size would be 8.
// For a struct containing 2 floats the basic element size would be 8.
// The default alignment is maximum 8.
//
//
// Because a blob can be used to exchange data between different systems,
// Because a blob can be used to exchange data between different systems,
// it must be possible to convert data as needed (for instance from big to
// it must be possible to convert data as needed (for instance from big to
...
...
This diff is collapsed.
Click to expand it.
LCS/Blob/src/BlobField2.cc
+
2
−
2
View file @
4f24cb04
...
@@ -161,7 +161,7 @@ namespace LOFAR {
...
@@ -161,7 +161,7 @@ namespace LOFAR {
}
}
}
}
uint
BlobFieldBase
::
p2divider
(
uint
value
)
uint
BlobFieldBase
::
p2divider
(
uint
value
,
uint
maxval
)
{
{
if
((
value
&
(
value
-
1
))
!=
0
)
{
if
((
value
&
(
value
-
1
))
!=
0
)
{
// No power of 2, so find greatest power of 2 that divides value.
// No power of 2, so find greatest power of 2 that divides value.
...
@@ -172,7 +172,7 @@ namespace LOFAR {
...
@@ -172,7 +172,7 @@ namespace LOFAR {
v
/=
2
;
v
/=
2
;
}
}
}
}
return
value
;
return
std
::
min
(
value
,
maxval
)
;
}
}
}
// end namespace
}
// end namespace
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment