Skip to content

Commit

Permalink
Merge branch 'develop' into future
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander authored Sep 3, 2023
2 parents 8f3ab1d + c8b9aae commit 9defa35
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 1 addition & 2 deletions contrib/mobile/mobile.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"net"
"regexp"
"runtime/debug"

"github.com/gologme/log"

Expand Down Expand Up @@ -43,7 +42,7 @@ func (m *Yggdrasil) StartAutoconfigure() error {
// StartJSON starts a node with the given JSON config. You can get JSON config
// (rather than HJSON) by using the GenerateConfigJSON() function
func (m *Yggdrasil) StartJSON(configjson []byte) error {
debug.SetMemoryLimit(1024 * 1024 * 40)
setMemLimitIfPossible()

logger := log.New(m.log, "", 0)
logger.EnableLevel("error")
Expand Down
10 changes: 10 additions & 0 deletions contrib/mobile/mobile_mem_go120.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build go1.20
// +build go1.20

package mobile

import "runtime/debug"

func setMemLimitIfPossible() {
debug.SetMemoryLimit(1024 * 1024 * 40)
}
8 changes: 8 additions & 0 deletions contrib/mobile/mobile_mem_other.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build !go1.20
// +build !go1.20

package mobile

func setMemLimitIfPossible() {
// not supported by this Go version
}

0 comments on commit 9defa35

Please sign in to comment.