Skip to content

freelist control #1603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2024
Merged

freelist control #1603

merged 1 commit into from
Sep 23, 2024

Conversation

Byron
Copy link
Member

@Byron Byron commented Sep 23, 2024

Fixes #1599 .

Tasks

  • sketch API
  • test everything

Sorry, something went wrong.

@Byron Byron marked this pull request as ready for review September 23, 2024 14:09

Verified

This commit was signed with the committer’s verified signature.
flavorjones Mike Dalessio
This is done by three new `Repository` methods:

* `empty_reusable_buffer()` - hook into the free-list yourself.
* `set_freelist()` - enable or initialize the free-list.
* `without_freelist()` - a builder to disable the freelist from the start.
/// Freelist configuration
///
/// The free-list is an internal and 'transparent' mechanism for obtaining and re-using memory buffers when
/// reading objects. That way, trashing is avoided as buffers are re-used and re-written.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// reading objects. That way, trashing is avoided as buffers are re-used and re-written.
/// reading objects. That way, thrashing is avoided as buffers are re-used and re-written.

is this a typo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, it wasn't a typo, but I realised now that it's not trashing at all :D.

Comment on lines +53 to +54
/// They are welcome to take out the data themselves, for instance when the object is detached, to avoid
/// it to be reclaimed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// They are welcome to take out the data themselves, for instance when the object is detached, to avoid
/// it to be reclaimed.
/// They are welcome to take out the data themselves, for instance when the object is detached, to avoid
/// it being reclaimed.

is this correct? I think otherwise the sentence is wonky

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! Would you be able to raise a new PR with the changes? Otherwise I can probably U-Boot the changes into the next PR.

@Byron Byron merged commit 73a7d15 into main Sep 23, 2024
16 checks passed
@Byron Byron deleted the freelist branch September 23, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gix::Repository - make freelist controllable
2 participants