[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

@ -2,8 +2,9 @@ package structr
import (
"os"
"sync"
"unsafe"
"codeberg.org/gruf/go-mempool"
)
type indexed_item struct {
@ -19,17 +20,15 @@ type indexed_item struct {
indexed []*index_entry
}
var indexed_item_pool sync.Pool
var indexed_item_pool mempool.UnsafePool
// new_indexed_item returns a new prepared indexed_item.
func new_indexed_item() *indexed_item {
v := indexed_item_pool.Get()
if v == nil {
i := new(indexed_item)
i.elem.data = unsafe.Pointer(i)
v = i
if ptr := indexed_item_pool.Get(); ptr != nil {
return (*indexed_item)(ptr)
}
item := v.(*indexed_item)
item := new(indexed_item)
item.elem.data = unsafe.Pointer(item)
return item
}
@ -43,7 +42,8 @@ func free_indexed_item(item *indexed_item) {
return
}
item.data = nil
indexed_item_pool.Put(item)
ptr := unsafe.Pointer(item)
indexed_item_pool.Put(ptr)
}
// drop_index will drop the given index entry from item's indexed.