mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 01:12:24 -05:00
[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:
parent
e7cd8bb43e
commit
ff950e94bb
32 changed files with 706 additions and 317 deletions
19
vendor/codeberg.org/gruf/go-structr/timeline.go
generated
vendored
19
vendor/codeberg.org/gruf/go-structr/timeline.go
generated
vendored
|
|
@ -8,6 +8,8 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
"unsafe"
|
||||
|
||||
"codeberg.org/gruf/go-mempool"
|
||||
)
|
||||
|
||||
// Direction defines a direction
|
||||
|
|
@ -1133,18 +1135,16 @@ func to_timeline_item(item *indexed_item) *timeline_item {
|
|||
return to
|
||||
}
|
||||
|
||||
var timeline_item_pool sync.Pool
|
||||
var timeline_item_pool mempool.UnsafePool
|
||||
|
||||
// new_timeline_item returns a new prepared timeline_item.
|
||||
func new_timeline_item() *timeline_item {
|
||||
v := timeline_item_pool.Get()
|
||||
if v == nil {
|
||||
i := new(timeline_item)
|
||||
i.elem.data = unsafe.Pointer(i)
|
||||
i.ck = ^uint(0)
|
||||
v = i
|
||||
if ptr := timeline_item_pool.Get(); ptr != nil {
|
||||
return (*timeline_item)(ptr)
|
||||
}
|
||||
item := v.(*timeline_item)
|
||||
item := new(timeline_item)
|
||||
item.elem.data = unsafe.Pointer(item)
|
||||
item.ck = ^uint(0)
|
||||
return item
|
||||
}
|
||||
|
||||
|
|
@ -1159,5 +1159,6 @@ func free_timeline_item(item *timeline_item) {
|
|||
}
|
||||
item.data = nil
|
||||
item.pk = nil
|
||||
timeline_item_pool.Put(item)
|
||||
ptr := unsafe.Pointer(item)
|
||||
timeline_item_pool.Put(ptr)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue