mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-30 14:23:35 -06:00
update modernc.org/sqlite to v1.37.0-concurrrency-workaround
This commit is contained in:
parent
9c31e213ca
commit
91f7bfa643
64 changed files with 1070 additions and 8220 deletions
20
vendor/modernc.org/memory/memory.go
generated
vendored
20
vendor/modernc.org/memory/memory.go
generated
vendored
|
|
@ -57,7 +57,6 @@ import (
|
|||
"fmt"
|
||||
"math/bits"
|
||||
"os"
|
||||
"reflect"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
|
|
@ -352,12 +351,7 @@ func (a *Allocator) Calloc(size int) (r []byte, err error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
var b []byte
|
||||
sh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
|
||||
sh.Cap = usableSize(p)
|
||||
sh.Data = p
|
||||
sh.Len = size
|
||||
return b, nil
|
||||
return (*rawmem)(unsafe.Pointer(p))[:size:usableSize(p)], nil
|
||||
}
|
||||
|
||||
// Close releases all OS resources used by a and sets it to its zero value.
|
||||
|
|
@ -396,11 +390,7 @@ func (a *Allocator) Malloc(size int) (r []byte, err error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
sh := (*reflect.SliceHeader)(unsafe.Pointer(&r))
|
||||
sh.Cap = usableSize(p)
|
||||
sh.Data = p
|
||||
sh.Len = size
|
||||
return r, nil
|
||||
return (*rawmem)(unsafe.Pointer(p))[:size:usableSize(p)], nil
|
||||
}
|
||||
|
||||
// Realloc changes the size of the backing array of b to size bytes or returns
|
||||
|
|
@ -422,11 +412,7 @@ func (a *Allocator) Realloc(b []byte, size int) (r []byte, err error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
sh := (*reflect.SliceHeader)(unsafe.Pointer(&r))
|
||||
sh.Cap = usableSize(p)
|
||||
sh.Data = p
|
||||
sh.Len = size
|
||||
return r, nil
|
||||
return (*rawmem)(unsafe.Pointer(p))[:size:usableSize(p)], nil
|
||||
}
|
||||
|
||||
// UsableSize reports the size of the memory block allocated at p, which must
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue