Make StableSize() do no allocations #49

Merged
fyrchik merged 6 commits from fyrchik/frostfs-api-go:fix-stablesize-alloc into master 2023-07-27 14:31:30 +00:00

It calculates size, it does so recursively, this can easily blow up in unexpected ways.

It calculates size, it does so recursively, this can easily blow up in unexpected ways.
fyrchik force-pushed fix-stablesize-alloc from aa700a83a2 to 849851f9ff 2023-07-26 15:15:28 +00:00 Compare
fyrchik requested review from storage-core-committers 2023-07-26 15:16:15 +00:00
fyrchik requested review from storage-core-developers 2023-07-26 15:16:15 +00:00
fyrchik requested review from storage-services-committers 2023-07-26 15:16:16 +00:00
fyrchik requested review from storage-services-developers 2023-07-26 15:16:16 +00:00
fyrchik force-pushed fix-stablesize-alloc from 849851f9ff to 7133a01ccf 2023-07-26 15:32:22 +00:00 Compare
fyrchik force-pushed fix-stablesize-alloc from 92d7680f9d to 7a5ee927c8 2023-07-26 15:53:07 +00:00 Compare
aarifullin reviewed 2023-07-26 17:17:25 +00:00
@ -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) {
Collaborator

repeatedUIntSize -> repeatedIntSize since you enumerated signed and unsigned integer types here?

`repeatedUIntSize` -> `repeatedIntSize` since you enumerated signed and unsigned integer types here?
Poster
Owner

I don't mind either option, chose UInt, because UInt64 is the lowest common denominator.

I don't mind either option, chose `UInt`, because `UInt64` is the lowest common denominator.
aarifullin approved these changes 2023-07-26 17:34:13 +00:00
dstepanov-yadro approved these changes 2023-07-27 14:26:46 +00:00
fyrchik merged commit 7a5ee927c8 into master 2023-07-27 14:31:30 +00:00
fyrchik deleted branch fix-stablesize-alloc 2023-07-27 14:31:31 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-committers
TrueCloudLab/storage-services-developers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-api-go#49
There is no content yet.