Skip to content
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

Version 0.5 #1

Open
wants to merge 23 commits into
base: trunk
Choose a base branch
from
Open

Version 0.5 #1

wants to merge 23 commits into from

Conversation

Caellian
Copy link
Owner

@Caellian Caellian commented Oct 19, 2023

Goals of this minor are:

  • Allow custom allocators to be used
  • Unification of implementation details
    • Automatic sync specific code generation
  • Separation and simplification of errors
  • Full example coverage of ContiguousMemory
  • Seeing other similar crates and what they do different/better and whether some improvements could be made so this crate provides similar levels of functionality
  • Explore whether it would be possible to use provided MemoryManager instead of default allocator for internal Vecs
    • Could lead to no-std support though that's... very hairy.

Fix `ContiguousMemoryStorage::resize` return type

Signed-off-by: Tin Svagelj <[email protected]>
Fix assume_stored returning a reference with invalid byte range.
Reduce number of lock acquisitions in sync code.
Fix push not handling alignment which caused the container to grow
twice in some cases.

Signed-off-by: Tin Svagelj <[email protected]>
Signed-off-by: Tin Svagelj <[email protected]>
Change base address representation
Cleanup interface
Improve documentation

Signed-off-by: Tin Svagelj <[email protected]>
Simplify return types
Improve resource management of implementations
Improve docs and add examples
Rename impl features

Signed-off-by: Tin Svagelj <[email protected]>
Fix doc examples

Signed-off-by: Tin Svagelj <[email protected]>
Add size function.
Handle zero-sized element insertion better.
Rename MemoryManager trait to ManageMemory.
Improve docs and add more examples.

Signed-off-by: Tin Svagelj <[email protected]>
Improve sync code and how locks are managed
Apply clippy suggestions

Signed-off-by: Tin Svagelj <[email protected]>
Separated on reference boundary so there's much unused implemented
types/fns.

Signed-off-by: Tin Svagelj <[email protected]>
Signed-off-by: Tin Svagelj <[email protected]>
Remove panics from AllocationTracker.
Rename AllocationTracker to SegmentTracker which is clearer.
Add supporting Location struct for peek_next to enforce validity of
peeked result.
Improve correctness of SegmentTracker implementation.
Simplify use of SegmentTracker.
Use peek_next in take_next to unify behavior.
Add can_store fn to SegmentTracker to make checks cheaper.
Improve SegmentTracker documentation.

Rename current reserve methods on ContiguousMemory to reserve_exact and
add reserve variants.
Reduce code duplication in those methods.
Reduce code duplication in some other parts of code.

Improve error messages and documentation.
Remove unused parts of types module and move some parts out.
Move ManageMemory and DefaultMemoryManager out of raw module and into
memory module.
Fix ByteRange::aligned method to shrink the result instead of offseting
it which is more correct.

Signed-off-by: Tin Svagelj <[email protected]>
Fix introduced issues for different feature flags

Signed-off-by: Tin Svagelj <[email protected]>
This is a pre-removal of sync code.

Turns out that it doesn't make much sense to internally control RwLocks
and Mutex because in some cases users might require different types of
access with different characteristics, so I believe a better approach
would be making the core impl. as quick and simple as possible and then
users of the library can wrap it in RwLock or Mutex as they see fit.

Otherwise, implementation is super complicated and difficult to modify
for those who aren't acquainted with the codebase. Given the permissive
nature of the license, and how niche the synchronised use case is, I
think it's a better choice to provide a simpler implementation which can
then be re-vendored and modified to fit specific requirements if
wrapping the structure in RwLock/Mutex isn't good enough.

I'm pushing this for future reference, but most of the changes in this
commit will be reverted.

Signed-off-by: Tin Svagelj <[email protected]>
Opened up API to implementing custom state referencing and inner
mutability which allows dependants to choose which syncronization
mechanism their use case would benefit most from.

Poisoning errors will cause reference getters to panic.

Signed-off-by: Tin Svagelj <[email protected]>
Cleanup documentation.
Remove some stale types.
Simplify some methods.
Fix no_std issues.
Fix clippy warnings.
Update github workflows.

Signed-off-by: Tin Švagelj <[email protected]>
@Caellian Caellian force-pushed the dev/0.5 branch 9 times, most recently from 85c9ec6 to 70069f2 Compare March 22, 2024 13:57
Update CI matrix to combine different features

Signed-off-by: Tin Švagelj <[email protected]>
Move some tests into documentation

Signed-off-by: Tin Švagelj <[email protected]>
Fix Layout import in examples

Signed-off-by: Tin Švagelj <[email protected]>
@Caellian Caellian force-pushed the dev/0.5 branch 2 times, most recently from c746b2b to e6c4569 Compare March 22, 2024 19:38
Signed-off-by: Tin Švagelj <[email protected]>
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.

None yet

1 participant