mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
```bash for file in `cat diffys`; do printf '%s\n%s\n' "// Copyright 2021 Molecula Corp. All rights reserved." "$(cat $file)" >$file; done ```
24 lines
512 B
Go
24 lines
512 B
Go
// Copyright 2021 Molecula Corp. All rights reserved.
|
|
package storage
|
|
|
|
import (
|
|
"sync/atomic"
|
|
)
|
|
|
|
// if enableRowCache, then we must not return mmap-ed memory
|
|
// directly, but only a copy.
|
|
var enableRowcache int64 = 1
|
|
|
|
// SetRowCacheOn should only be called in NewHolder before
|
|
// all other reads.
|
|
func SetRowCacheOn(on bool) {
|
|
if on {
|
|
atomic.StoreInt64(&enableRowcache, 1)
|
|
} else {
|
|
atomic.StoreInt64(&enableRowcache, 0)
|
|
}
|
|
}
|
|
|
|
func RowCacheEnabled() bool {
|
|
return atomic.LoadInt64(&enableRowcache) == 1
|
|
}
|