mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 08:18:52 +08:00
refactor memory map related code
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
package needle
|
||||
|
||||
import "strconv"
|
||||
|
||||
func ReadMemoryMapMaxSizeMb(MemoryMapMaxSizeMbString string) (uint32, error) {
|
||||
if MemoryMapMaxSizeMbString == "" {
|
||||
return 0, nil
|
||||
}
|
||||
var MemoryMapMaxSize64 uint64
|
||||
var err error
|
||||
MemoryMapMaxSize64, err = strconv.ParseUint(MemoryMapMaxSizeMbString, 10, 32)
|
||||
MemoryMapMaxSize := uint32(MemoryMapMaxSize64)
|
||||
return MemoryMapMaxSize, err
|
||||
}
|
@@ -1,10 +0,0 @@
|
||||
package needle
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestMemoryMapMaxSizeReadWrite(t *testing.T) {
|
||||
memoryMapSize, _ := ReadMemoryMapMaxSizeMb("5000")
|
||||
if memoryMapSize != 5000 {
|
||||
t.Errorf("empty memoryMapSize:%v", memoryMapSize)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user