mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
Only set mobile memory limit on supported Go versions
This commit is contained in:
parent
12a3a8c73b
commit
c8b9aaeb67
3 changed files with 19 additions and 2 deletions
10
contrib/mobile/mobile_mem_go120.go
Normal file
10
contrib/mobile/mobile_mem_go120.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
//go:build go1.20
|
||||
// +build go1.20
|
||||
|
||||
package mobile
|
||||
|
||||
import "runtime/debug"
|
||||
|
||||
func setMemLimitIfPossible() {
|
||||
debug.SetMemoryLimit(1024 * 1024 * 40)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue