[chore] update dependencies (#4468)

- github.com/ncruces/go-sqlite3
- codeberg.org/gruf/go-mempool
- codeberg.org/gruf/go-structr (changes related on the above) *
- codeberg.org/gruf/go-mutexes (changes related on the above) *

* this is largely just fiddling around with package internals in structr and mutexes to rely on changes in mempool, which added a new concurrency-safe pool

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4468
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
kim 2025-10-03 15:29:41 +02:00 committed by kim
commit ff950e94bb
32 changed files with 706 additions and 317 deletions

View file

@ -4,10 +4,10 @@ import (
"os"
"reflect"
"strings"
"sync"
"unsafe"
"codeberg.org/gruf/go-byteutil"
"codeberg.org/gruf/go-mempool"
"codeberg.org/gruf/go-xunsafe"
)
@ -371,17 +371,15 @@ type index_entry struct {
key string
}
var index_entry_pool sync.Pool
var index_entry_pool mempool.UnsafePool
// new_index_entry returns a new prepared index_entry.
func new_index_entry() *index_entry {
v := index_entry_pool.Get()
if v == nil {
e := new(index_entry)
e.elem.data = unsafe.Pointer(e)
v = e
if ptr := index_entry_pool.Get(); ptr != nil {
return (*index_entry)(ptr)
}
entry := v.(*index_entry)
entry := new(index_entry)
entry.elem.data = unsafe.Pointer(entry)
return entry
}
@ -396,7 +394,8 @@ func free_index_entry(entry *index_entry) {
entry.key = ""
entry.index = nil
entry.item = nil
index_entry_pool.Put(entry)
ptr := unsafe.Pointer(entry)
index_entry_pool.Put(ptr)
}
func is_unique(f uint8) bool {