mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-18 00:47:30 -06:00
bump modernc.org/sqlite to v1.35.0-concurrency-workaround (#3797)
This commit is contained in:
parent
879ca2d2f8
commit
ebbdeee0bb
114 changed files with 891873 additions and 192475 deletions
2
vendor/modernc.org/mathutil/Makefile
generated
vendored
2
vendor/modernc.org/mathutil/Makefile
generated
vendored
|
|
@ -28,7 +28,7 @@ cpu: clean
|
|||
go tool pprof -lines *.test cpu.out
|
||||
|
||||
edit:
|
||||
@ 1>/dev/null 2>/dev/null gvim -p Makefile *.go &
|
||||
@ 1>/dev/null 2>/dev/null gvim -p Makefile go.mod builder.json *.go &
|
||||
|
||||
editor:
|
||||
gofmt -l -s -w *.go
|
||||
|
|
|
|||
6
vendor/modernc.org/mathutil/builder.json
generated
vendored
Normal file
6
vendor/modernc.org/mathutil/builder.json
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"autogen": "<none>",
|
||||
"autoupdate": ".",
|
||||
"autotag": ".",
|
||||
"test": "."
|
||||
}
|
||||
84
vendor/modernc.org/mathutil/mathutil.go
generated
vendored
84
vendor/modernc.org/mathutil/mathutil.go
generated
vendored
|
|
@ -5,7 +5,7 @@
|
|||
// Package mathutil provides utilities supplementing the standard 'math' and
|
||||
// 'math/rand' packages.
|
||||
//
|
||||
// Release history and compatibility issues
|
||||
// # Release history and compatibility issues
|
||||
//
|
||||
// 2020-12-20 v1.2.1 fixes MulOverflowInt64.
|
||||
//
|
||||
|
|
@ -14,50 +14,52 @@
|
|||
// 2018-10-21 Added BinaryLog
|
||||
//
|
||||
// 2018-04-25: New functions for determining Max/Min of nullable values. Ex:
|
||||
// func MaxPtr(a, b *int) *int {
|
||||
// func MinPtr(a, b *int) *int {
|
||||
// func MaxBytePtr(a, b *byte) *byte {
|
||||
// func MinBytePtr(a, b *byte) *byte {
|
||||
// ...
|
||||
//
|
||||
// func MaxPtr(a, b *int) *int {
|
||||
// func MinPtr(a, b *int) *int {
|
||||
// func MaxBytePtr(a, b *byte) *byte {
|
||||
// func MinBytePtr(a, b *byte) *byte {
|
||||
// ...
|
||||
//
|
||||
// 2017-10-14: New variadic functions for Max/Min. Ex:
|
||||
// func MaxVal(val int, vals ...int) int {
|
||||
// func MinVal(val int, vals ...int) int {
|
||||
// func MaxByteVal(val byte, vals ...byte) byte {
|
||||
// func MinByteVal(val byte, vals ...byte) byte {
|
||||
// ...
|
||||
//
|
||||
// func MaxVal(val int, vals ...int) int {
|
||||
// func MinVal(val int, vals ...int) int {
|
||||
// func MaxByteVal(val byte, vals ...byte) byte {
|
||||
// func MinByteVal(val byte, vals ...byte) byte {
|
||||
// ...
|
||||
//
|
||||
// 2016-10-10: New functions QuadPolyDiscriminant and QuadPolyFactors.
|
||||
//
|
||||
// 2013-12-13: The following functions have been REMOVED
|
||||
//
|
||||
// func Uint64ToBigInt(n uint64) *big.Int
|
||||
// func Uint64FromBigInt(n *big.Int) (uint64, bool)
|
||||
// func Uint64ToBigInt(n uint64) *big.Int
|
||||
// func Uint64FromBigInt(n *big.Int) (uint64, bool)
|
||||
//
|
||||
// 2013-05-13: The following functions are now DEPRECATED
|
||||
//
|
||||
// func Uint64ToBigInt(n uint64) *big.Int
|
||||
// func Uint64FromBigInt(n *big.Int) (uint64, bool)
|
||||
// func Uint64ToBigInt(n uint64) *big.Int
|
||||
// func Uint64FromBigInt(n *big.Int) (uint64, bool)
|
||||
//
|
||||
// These functions will be REMOVED with Go release 1.1+1.
|
||||
//
|
||||
// 2013-01-21: The following functions have been REMOVED
|
||||
//
|
||||
// func MaxInt() int
|
||||
// func MinInt() int
|
||||
// func MaxUint() uint
|
||||
// func UintPtrBits() int
|
||||
// func MaxInt() int
|
||||
// func MinInt() int
|
||||
// func MaxUint() uint
|
||||
// func UintPtrBits() int
|
||||
//
|
||||
// They are now replaced by untyped constants
|
||||
//
|
||||
// MaxInt
|
||||
// MinInt
|
||||
// MaxUint
|
||||
// UintPtrBits
|
||||
// MaxInt
|
||||
// MinInt
|
||||
// MaxUint
|
||||
// UintPtrBits
|
||||
//
|
||||
// Additionally one more untyped constant was added
|
||||
//
|
||||
// IntBits
|
||||
// IntBits
|
||||
//
|
||||
// This change breaks any existing code depending on the above removed
|
||||
// functions. They should have not been published in the first place, that was
|
||||
|
|
@ -71,8 +73,8 @@
|
|||
// 1.0.3+1 and REMOVED with Go release 1.0.3+2, b/c of
|
||||
// http://code.google.com/p/go/source/detail?r=954a79ee3ea8
|
||||
//
|
||||
// func Uint64ToBigInt(n uint64) *big.Int
|
||||
// func Uint64FromBigInt(n *big.Int) (uint64, bool)
|
||||
// func Uint64ToBigInt(n uint64) *big.Int
|
||||
// func Uint64FromBigInt(n *big.Int) (uint64, bool)
|
||||
package mathutil // import "modernc.org/mathutil"
|
||||
|
||||
import (
|
||||
|
|
@ -507,20 +509,20 @@ k == 1.
|
|||
Wrt pseudocode shown at
|
||||
http://en.wikipedia.org/wiki/Miller-Rabin_primality_test#Algorithm_and_running_time
|
||||
|
||||
Input: n > 3, an odd integer to be tested for primality;
|
||||
Input: k, a parameter that determines the accuracy of the test
|
||||
Output: composite if n is composite, otherwise probably prime
|
||||
write n − 1 as 2^s·d with d odd by factoring powers of 2 from n − 1
|
||||
LOOP: repeat k times:
|
||||
pick a random integer a in the range [2, n − 2]
|
||||
x ← a^d mod n
|
||||
if x = 1 or x = n − 1 then do next LOOP
|
||||
for r = 1 .. s − 1
|
||||
x ← x^2 mod n
|
||||
if x = 1 then return composite
|
||||
if x = n − 1 then do next LOOP
|
||||
return composite
|
||||
return probably prime
|
||||
Input: n > 3, an odd integer to be tested for primality;
|
||||
Input: k, a parameter that determines the accuracy of the test
|
||||
Output: composite if n is composite, otherwise probably prime
|
||||
write n − 1 as 2^s·d with d odd by factoring powers of 2 from n − 1
|
||||
LOOP: repeat k times:
|
||||
pick a random integer a in the range [2, n − 2]
|
||||
x ← a^d mod n
|
||||
if x = 1 or x = n − 1 then do next LOOP
|
||||
for r = 1 .. s − 1
|
||||
x ← x^2 mod n
|
||||
if x = 1 then return composite
|
||||
if x = n − 1 then do next LOOP
|
||||
return composite
|
||||
return probably prime
|
||||
|
||||
... this function behaves like passing 1 for 'k' and additionally a
|
||||
fixed/non-random 'a'. Otherwise it's the same algorithm.
|
||||
|
|
@ -1385,7 +1387,7 @@ func ClampInt64(v, lo, hi int64) int64 {
|
|||
|
||||
// ToBase produces n in base b. For example
|
||||
//
|
||||
// ToBase(2047, 22) -> [1, 5, 4]
|
||||
// ToBase(2047, 22) -> [1, 5, 4]
|
||||
//
|
||||
// 1 * 22^0 1
|
||||
// 5 * 22^1 110
|
||||
|
|
|
|||
7
vendor/modernc.org/mathutil/rat.go
generated
vendored
7
vendor/modernc.org/mathutil/rat.go
generated
vendored
|
|
@ -6,10 +6,9 @@ package mathutil // import "modernc.org/mathutil"
|
|||
|
||||
// QCmpUint32 compares a/b and c/d and returns:
|
||||
//
|
||||
// -1 if a/b < c/d
|
||||
// 0 if a/b == c/d
|
||||
// +1 if a/b > c/d
|
||||
//
|
||||
// -1 if a/b < c/d
|
||||
// 0 if a/b == c/d
|
||||
// +1 if a/b > c/d
|
||||
func QCmpUint32(a, b, c, d uint32) int {
|
||||
switch x, y := uint64(a)*uint64(d), uint64(b)*uint64(c); {
|
||||
case x < y:
|
||||
|
|
|
|||
12
vendor/modernc.org/mathutil/rnd.go
generated
vendored
12
vendor/modernc.org/mathutil/rnd.go
generated
vendored
|
|
@ -15,12 +15,12 @@ import (
|
|||
// this code doesn't produce values at constant delta (mod cycle length).
|
||||
// The 32 bit limit is per this implementation, the algorithm used has no intrinsic limit on the cycle size.
|
||||
// Properties include:
|
||||
// - Adjustable limits on creation (hi, lo).
|
||||
// - Positionable/randomly accessible (Pos, Seek).
|
||||
// - Repeatable (deterministic).
|
||||
// - Can run forward or backward (Next, Prev).
|
||||
// - For a billion numbers cycle the Next/Prev PRN can be produced in cca 100-150ns.
|
||||
// That's like 5-10 times slower compared to PRNs generated using the (non FC) rand package.
|
||||
// - Adjustable limits on creation (hi, lo).
|
||||
// - Positionable/randomly accessible (Pos, Seek).
|
||||
// - Repeatable (deterministic).
|
||||
// - Can run forward or backward (Next, Prev).
|
||||
// - For a billion numbers cycle the Next/Prev PRN can be produced in cca 100-150ns.
|
||||
// That's like 5-10 times slower compared to PRNs generated using the (non FC) rand package.
|
||||
type FC32 struct {
|
||||
cycle int64 // On average: 3 * delta / 2, (HQ: 2 * delta)
|
||||
delta int64 // hi - lo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue