mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
Merge branch 'master' into 54mir/rename-pilosa-docker2
This commit is contained in:
commit
db5143b7af
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue