Make StableSize() do no allocations #49
No reviewers
TrueCloudLab/storage-services-committers
TrueCloudLab/storage-services-developers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-api-go#49
Loading…
Reference in a new issue
No description provided.
Delete branch "fyrchik/frostfs-api-go:fix-stablesize-alloc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It calculates size, it does so recursively, this can easily blow up in unexpected ways.
aa700a83a2
to849851f9ff
849851f9ff
to7133a01ccf
92d7680f9d
to7a5ee927c8
@ -197,3 +188,1 @@
}
func RepeatedUInt64Size(field int, v []uint64) (size, arraySize int) {
func repeatedUIntSize[T ~uint64 | ~int64 | ~uint32 | ~int32](field int, v []T) (size, arraySize int) {
repeatedUIntSize
->repeatedIntSize
since you enumerated signed and unsigned integer types here?I don't mind either option, chose
UInt
, becauseUInt64
is the lowest common denominator.