Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
d6cc96c2
Commit
d6cc96c2
authored
Nov 27, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce low memory flag
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
779ea51b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
bitswap.go
bitswap.go
+11
-0
No files found.
bitswap.go
View file @
d6cc96c2
...
...
@@ -17,6 +17,7 @@ import (
bsnet
"github.com/ipfs/go-ipfs/exchange/bitswap/network"
notifications
"github.com/ipfs/go-ipfs/exchange/bitswap/notifications"
wantlist
"github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
flags
"github.com/ipfs/go-ipfs/flags"
"github.com/ipfs/go-ipfs/thirdparty/delay"
process
"gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess"
procctx
"gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/context"
...
...
@@ -39,12 +40,22 @@ const (
sizeBatchRequestChan
=
32
// kMaxPriority is the max priority as defined by the bitswap protocol
kMaxPriority
=
math
.
MaxInt32
)
var
(
HasBlockBufferSize
=
256
provideKeysBufferSize
=
2048
provideWorkerMax
=
512
)
func
init
()
{
if
flags
.
LowMemMode
{
HasBlockBufferSize
=
64
provideKeysBufferSize
=
512
provideWorkerMax
=
16
}
}
var
rebroadcastDelay
=
delay
.
Fixed
(
time
.
Second
*
10
)
// New initializes a BitSwap instance that communicates over the provided
...
...
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