Merge branch 'master' into 54mir/rename-pilosa-docker2

This commit is contained in:
tgruben 2021-09-23 10:03:53 -05:00 committed by GitHub
commit db5143b7af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,7 @@ import (
"sync"
"sync/atomic"
"syscall"
"strings"
"github.com/pkg/errors"
)
@ -56,6 +57,9 @@ func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e
data, err = syscall.Mmap(fd, offset, length, prot, flags)
if err != nil {
atomic.AddUint64(&mapCount, ^uint64(0)) // decrement
if strings.Contains(err.Error(), "cannot allocate memory") {
err = errors.New("mmap 'cannot allocate memory' — please see the troubleshooting how-to in the FeatureBase docs.")
}
}
return data, err
}