Skip to content

Commit 368ab19

Browse files
lplewabratpiorka
authored andcommitted
Rename bucket_capacity to bucket_ma_pooled_slabs
this function has nothing releated to capacity. input parameter to disjointpool should also be renamed, but this is topic for the diffrent pull request Signed-off-by: Łukasz Plewa <[email protected]>
1 parent b6181b6 commit 368ab19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pool/pool_disjoint.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ static slab_list_item_t *bucket_get_avail_slab(bucket_t *bucket,
378378
return bucket->available_slabs;
379379
}
380380

381-
static size_t bucket_capacity(bucket_t *bucket) {
382-
// For buckets used in chunked mode, just one slab in pool is sufficient.
381+
static size_t bucket_max_pooled_slabs(bucket_t *bucket) {
382+
// For small buckets where slabs are split to chunks, just one pooled slab is sufficient.
383383
// For larger buckets, the capacity could be more and is adjustable.
384384
if (bucket->size <= bucket_chunk_cut_off(bucket)) {
385385
return 1;
@@ -419,7 +419,7 @@ static bool bucket_can_pool(bucket_t *bucket) {
419419
new_free_slabs_in_bucket = bucket->chunked_slabs_in_pool + 1;
420420

421421
// we keep at most params.capacity slabs in the pool
422-
if (bucket_capacity(bucket) >= new_free_slabs_in_bucket) {
422+
if (bucket_max_pooled_slabs(bucket) >= new_free_slabs_in_bucket) {
423423
size_t pool_size = 0;
424424
utils_atomic_load_acquire(&bucket->shared_limits->total_size,
425425
&pool_size);

0 commit comments

Comments
 (0)