mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
Adiantum encrypting VFS. (#77)
This commit is contained in:
@@ -25,7 +25,7 @@ func (s *mmapState) init(ctx context.Context, enabled bool) context.Context {
|
||||
return ctx
|
||||
}
|
||||
|
||||
func CanMap(ctx context.Context) bool {
|
||||
func CanMapFiles(ctx context.Context) bool {
|
||||
s := ctx.Value(moduleKey{}).(*moduleState)
|
||||
return s.mmapState.enabled
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ func (s *mmapState) init(ctx context.Context, _ bool) context.Context {
|
||||
return ctx
|
||||
}
|
||||
|
||||
func CanMap(ctx context.Context) bool {
|
||||
func CanMapFiles(ctx context.Context) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
8
internal/util/unwrap.go
Normal file
8
internal/util/unwrap.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package util
|
||||
|
||||
func Unwrap[T any](v T) T {
|
||||
if u, ok := any(v).(interface{ Unwrap() T }); ok {
|
||||
return u.Unwrap()
|
||||
}
|
||||
return v
|
||||
}
|
||||
Reference in New Issue
Block a user