Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
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
jacobsa-fuse
Commits
11443270
Commit
11443270
authored
Jul 28, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check alignment.
parent
c210aa8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
internal/buffer/out_message.go
internal/buffer/out_message.go
+12
-0
No files found.
internal/buffer/out_message.go
View file @
11443270
...
...
@@ -15,6 +15,7 @@
package
buffer
import
(
"log"
"unsafe"
"github.com/jacobsa/fuse/internal/fusekernel"
...
...
@@ -36,6 +37,17 @@ type OutMessage struct {
storage
[
outMessageSize
]
byte
}
// Make sure alignment works out correctly, at least for the header.
func
init
()
{
a
:=
unsafe
.
Alignof
(
OutMessage
{})
o
:=
unsafe
.
Offsetof
(
OutMessage
{}
.
storage
)
e
:=
unsafe
.
Alignof
(
fusekernel
.
OutHeader
{})
if
a
%
e
!=
0
||
o
%
e
!=
0
{
log
.
Panicf
(
"Bad alignment or offset: %d, %d, need %d"
,
a
,
o
,
e
)
}
}
// Reset the message so that it is ready to be used again. Afterward, the
// contents are solely a zeroed header.
func
(
m
*
OutMessage
)
Reset
()
{
...
...
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