Do not measure size of sync.WaitGroup

Signed-off-by: Marco Pracucci <marco@pracucci.com>
This commit is contained in:
Marco Pracucci 2023-09-27 15:50:39 +02:00
parent e2c1e7aadc
commit 0a8b79ad29
No known key found for this signature in database
GPG key ID: 74C1BD403D2DF9B5

View file

@ -112,7 +112,7 @@ func (c *PostingsForMatchersCache) postingsForMatchersPromise(ctx context.Contex
// Estimate the size of the cache entry, in bytes. We use max() because // Estimate the size of the cache entry, in bytes. We use max() because
// size.Of() returns -1 if the value is nil. // size.Of() returns -1 if the value is nil.
estimatedSizeBytes := int64(len(key)) + max(0, int64(size.Of(wg))) + max(0, int64(size.Of(outerErr))) + max(0, int64(size.Of(cloner))) estimatedSizeBytes := int64(len(key)) + max(0, int64(size.Of(outerErr))) + max(0, int64(size.Of(cloner)))
c.created(key, c.timeNow(), estimatedSizeBytes) c.created(key, c.timeNow(), estimatedSizeBytes)
return promise return promise