Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Add freelist to environment #41

Merged
merged 1 commit into from
Apr 4, 2019
Merged

Conversation

ncloudioj
Copy link
Member

@ncloudioj ncloudioj commented Apr 3, 2019

This allows the consumer to query the total # of pages on the freelist for each LMDB environment, then they can use it with env.info() to precisely check the space usage of that environment.

Note: the approach that I used to query the freelist was not documented in LMDB but a direct copy from its utility mdb_stat. I won't feel bad if we decide to not use the uncharted stuff from LMDB. 😉

@ncloudioj ncloudioj requested a review from mykmelez April 3, 2019 15:53
@ncloudioj ncloudioj force-pushed the freelist branch 2 times, most recently from 8f6ea62 to d8ebcad Compare April 3, 2019 18:28
@mykmelez
Copy link

mykmelez commented Apr 3, 2019

Note: the approach that I used to query the freelist was not documented in LMDB but a direct copy from its utility mdb_stat. I won't feel bad if we decide to not use the uncharted stuff from LMDB. 😉

I'm ok with this, although it'd be useful to document it in a doc comment on the function in question.

This also makes me wish for rust-lang/rfcs#1491, so we can identify this function as unstable. Although I guess all functions exported by this crate are potentially unstable, given its pre-1.0 status.

Copy link

@mykmelez mykmelez left a comment

Choose a reason for hiding this comment

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

Nit: the only other thing I'd add are some hints about how this API could be used.

Unverified

No user is associated with the committer email.
@ncloudioj
Copy link
Member Author

Thanks!

Added more document to describe the usage and potential use cases.

@ncloudioj ncloudioj merged commit d62da60 into mozilla:master Apr 4, 2019
@ncloudioj ncloudioj deleted the freelist branch April 4, 2019 14:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants