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
6f4af617
Commit
6f4af617
authored
Dec 19, 2016
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
buffer: consistently use 'm' for OutMessage receivers.
parent
98a2b634
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
internal/buffer/out_message.go
internal/buffer/out_message.go
+11
-11
No files found.
internal/buffer/out_message.go
View file @
6f4af617
...
...
@@ -77,20 +77,20 @@ func (m *OutMessage) OutHeader() (h *fusekernel.OutHeader)
// Grow grows m's buffer by the given number of bytes, returning a pointer to
// the start of the new segment, which is guaranteed to be zeroed. If there is
// insufficient space, it returns nil.
func
(
b
*
OutMessage
)
Grow
(
n
int
)
(
p
unsafe
.
Pointer
)
func
(
m
*
OutMessage
)
Grow
(
n
int
)
(
p
unsafe
.
Pointer
)
// GrowNoZero is equivalent to Grow, except the new segment is not zeroed. Use
// with caution!
func
(
b
*
OutMessage
)
GrowNoZero
(
n
int
)
(
p
unsafe
.
Pointer
)
func
(
m
*
OutMessage
)
GrowNoZero
(
n
int
)
(
p
unsafe
.
Pointer
)
// ShrinkTo shrinks m to the given size. It panics if the size is greater than
// Len() or less than OutMessageHeaderSize.
func
(
b
*
OutMessage
)
ShrinkTo
(
n
int
)
func
(
m
*
OutMessage
)
ShrinkTo
(
n
int
)
// Append is equivalent to growing by len(src), then copying src over the new
// segment. Int panics if there is not enough room available.
func
(
b
*
OutMessage
)
Append
(
src
[]
byte
)
{
p
:=
b
.
GrowNoZero
(
len
(
src
))
func
(
m
*
OutMessage
)
Append
(
src
[]
byte
)
{
p
:=
m
.
GrowNoZero
(
len
(
src
))
if
p
==
nil
{
panic
(
fmt
.
Sprintf
(
"Can't grow %d bytes"
,
len
(
src
)))
}
...
...
@@ -102,8 +102,8 @@ func (b *OutMessage) Append(src []byte) {
}
// AppendString is like Append, but accepts string input.
func
(
b
*
OutMessage
)
AppendString
(
src
string
)
{
p
:=
b
.
GrowNoZero
(
len
(
src
))
func
(
m
*
OutMessage
)
AppendString
(
src
string
)
{
p
:=
m
.
GrowNoZero
(
len
(
src
))
if
p
==
nil
{
panic
(
fmt
.
Sprintf
(
"Can't grow %d bytes"
,
len
(
src
)))
}
...
...
@@ -115,12 +115,12 @@ func (b *OutMessage) AppendString(src string) {
}
// Len returns the current size of the message, including the leading header.
func
(
b
*
OutMessage
)
Len
()
int
{
return
int
(
b
.
offset
)
func
(
m
*
OutMessage
)
Len
()
int
{
return
OutMessageHeaderSize
+
m
.
payloadOffset
}
// Bytes returns a reference to the current contents of the buffer, including
// the leading header.
func
(
b
*
OutMessage
)
Bytes
()
[]
byte
{
return
b
.
storage
[
:
int
(
b
.
offset
)]
func
(
m
*
OutMessage
)
Bytes
()
[]
byte
{
return
int
(
m
.
offset
)
}
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