ibuf: introduce the new method ibuf_shrink#58
Merged
alyapunov merged 2 commits intotarantool:masterfrom Jan 27, 2023
Merged
Conversation
locker
reviewed
Jan 16, 2023
ibuf_reserve_slow to ibuf_resizeibuf_shrink
locker
reviewed
Jan 17, 2023
locker
previously approved these changes
Jan 18, 2023
alyapunov
suggested changes
Jan 19, 2023
locker
reviewed
Jan 19, 2023
locker
approved these changes
Jan 23, 2023
locker
approved these changes
Jan 27, 2023
It computes the actual size of a slab, that will be allocated by slab_get() for the requested number of bytes. Needed for tarantool/tarantool#8108
It shrinks the buffer to the minimal possible capacity needed to store the data written to the buffer and not yet consumed. Needed for tarantool/tarantool#8108
alyapunov
approved these changes
Jan 27, 2023
alyapunov
reviewed
Jan 27, 2023
| * less than the real size by slab_sizeof(). | ||
| */ | ||
| size_t | ||
| slab_real_size(struct slab_cache *cache, size_t size); |
Contributor
There was a problem hiding this comment.
We decided that when we need a method that returns actual capacity of expected slab we will add a one-line slab_real_capacity method.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It shrinks the buffer to the minimum possible capacity, in order to return the memory to the slab allocator.
Needed for tarantool/tarantool#8108
Do not merge until tarantool/tarantool#8113 is approved!