Commit graph

42 commits

Author SHA1 Message Date
janis df6ab625cc
a bunch of stuff init 2025-10-01 14:18:37 +02:00
janis cc6b783be9
fix parent indices 2025-09-18 20:41:39 +02:00
janis 216485e448
impl drop for free 2025-09-18 19:29:00 +02:00
janis 81f92738db
work on iterating 2025-09-17 18:06:36 +02:00
janis c2cecdf85f
copy+clone for handle 2025-09-17 14:04:37 +02:00
janis 5e1a4a245a
trie innit 2025-09-17 00:57:15 +02:00
janis 3e3b096174
refactor HandleOrTree to generic TreeOr type 2025-09-16 19:22:08 +02:00
janis 96e7045d5b
idk man.. 2025-09-16 19:02:13 +02:00
janis cf94f58583
gate test for transposed option which uses try_blocks 2025-09-16 18:55:36 +02:00
janis a8cebcc805
unique ptr 2025-09-16 18:55:26 +02:00
Janis 41f8763f18 refactor(tree): remove unused constants, debug prints, and imports
- Removed unused constants and redundant imports.
- Eliminated debug print statements from the `search` module.
- Added `#[allow(dead_code)]` annotations to suppress warnings for unused functions.
- Made `Tree` and `as_subtree_mut` public
2025-08-15 23:46:43 +02:00
Janis 9663e95210 refactor(tree): simplify NodeRef type by removing redundant parameters
- Removed the `Type` parameter from `NodeRef` and related structs and methods
2025-08-15 23:25:05 +02:00
Janis b11805aacd refactor(tree): simplify node structure and improve memory handling
- Replaced `InternalNode` with a unified `LeafNode` structure to simplify
  the node hierarchy and reduce redundancy.
- Introduced `capacity` field in `LeafNode` to dynamically manage keys
  and edges, replacing fixed-size arrays.
- Added methods for growing node capacity and handling dynamic memory
  allocation for keys and edges.
- Updated `NodeRef` methods to work with the new `LeafNode` structure,
  including safe handling of raw pointers and memory operations.
- Adjusted tests to reflect the new node structure and ensure correctness.
2025-08-15 23:01:04 +02:00
Janis affa52ba73 feat(tree): add mutable subtree access and traversal methods
- Introduced `into_value_mut` for mutable value access in `Handle`
- Added `into_subtree` for converting OccupiedEntries into mutable subtrees
- Refactored `SubtreeMut` into a generic `Subtree` supporting borrow types
- Implemented `get_subtree` and `get_subtree_mut` for subtree traversal
- Updated `Tree` to use the new `Subtree` abstraction
2025-08-11 22:43:34 +02:00
Janis ebd259d78c refactor(tree): simplify tree mutation and entry handling
- Introduced `SubtreeMut` for encapsulating mutable subtree operations
- Simplified `Tree::entry` by delegating to `SubtreeMut::entry`
- Removed redundant and commented-out code for clarity
- Added `Handle::value_mut` for mutable access to node values
2025-08-11 18:58:53 +02:00
Janis 2dd4697b29 refactor(tree): improve node handling and add tests for leaf promotion
- Refactored `InternalNode` initialization and parent-child relationships
  to improve clarity and safety.
- made `InternalNode` `repr(C)` because I was stupid
- Added `reparent` method to simplify node reparenting logic.
- Introduced `as_leaf_non_null` for safer leaf node handling.
- Updated test utilities to streamline insertion and debugging.
- Added a new test case `promote_leaf` to validate leaf promotion logic.
2025-08-08 21:52:01 +02:00
Janis e07e69a0c4 feat(tree): enhance tree structure with debug traits and new methods
- Add `Debug` implementations for tree-related structs and enums
- Introduce new methods for node manipulation, including `make_internal_node`
- Refactor `Tree::entry` to support key insertion and retrieval
- Improve internal node handling with enhanced parent-child link management
- Add test cases for tree operations and debug output
2025-08-08 20:57:02 +02:00
Janis b6c16f2739 feat(tree): enhance tree structure with new features and optimizations
- Added support for `maybe_uninit_slice` feature in `lib.rs`
- Introduced `Borrow` and `Ordering` imports in `tree.rs`
- Refactored marker structs and renamed `KV` to `Value`, `Immutable` to `Immut`
- Updated `LeafNode` to use `Option<MaybeUninit<V>>` for value storage
- Simplified `NodeRef` type parameters and added `Sync` and `Send` implementations
- Enhanced `Handle` with `new_value` method for value handling
- Added methods for parent link correction and child link management
- Implemented `search` module for tree traversal and key lookup
- Introduced `entry` module for managing vacant and occupied entries
- Added `DormantMutRef` utility for safe mutable reference reborrowing
2025-08-08 17:45:13 +02:00
Janis 10e762e730 invested actual thought into this 2025-08-08 01:08:06 +02:00
Janis 7939d6df47 copy from std::tree 2025-08-08 01:08:06 +02:00
Janis 9db415a7c9 add AdvanceWhile trait for conditional iterator advancement 2025-08-08 00:57:28 +02:00
Janis 1aee8d2f1c feat(Cargo): add nightly feature to default configuration 2025-08-08 00:33:00 +02:00
Janis 9e3fa2cdb0 u32,u64,u16 conversion functions, sync queue, random utilities
- `NextIf` iterator trait that yields the next element iff some predicate holds
- `u64_from_u32s`, `u32s_from_u64`, `u32_from_u16s`, `u16s_from_u32` functions
- moved `can_transmute` to `mem` module, added `is_same_size` and `is_aligned`
functions
- `copy_from` function for `TaggedAtomicPtr`
- attempt at a sync queue?
- `is_whitespace` function
2025-08-06 22:51:27 +02:00
Janis b3d4159883 Option type which short-cirtuits on Some instead of None in Try contexts 2025-07-06 15:05:04 +02:00
Janis b22254cb32 comments 2025-07-06 15:04:58 +02:00
Janis 568d14aa9c sync channel inspired by chili 2025-07-06 14:26:51 +02:00
Janis 5a3b6447f3 slight refactor of Lock 2025-07-06 14:26:39 +02:00
Janis 4c70dbfc71 Parker: park with callback before waiting 2025-07-05 14:21:31 +02:00
Janis c9e69c3b06 cachepadded: turn into pub newtype 2025-07-05 14:21:15 +02:00
Janis eee2f8995a Thread parker 2025-07-04 18:37:41 +02:00
Janis 7f7a1c3314 AtomicOption try_set, into/from_option 2025-07-04 13:29:47 +02:00
Janis c2f1d8d749 AtomicTaggedPtr compareexchange ptr part, remove unsafe nonnull conversions 2025-07-04 13:29:26 +02:00
Janis 1ea8bcb3ed atomiccell 2025-07-03 16:50:41 +02:00
Janis 4f1e4b1672 small fixes, std implies alloc, dropguarded wrapper with dropguard 2025-07-03 16:50:20 +02:00
Janis f23f815708 simple atomic lock 2025-07-02 22:37:56 +02:00
Janis 71f1767092 nightly feature gate 2025-07-02 21:50:24 +02:00
Janis 42443518e1 taggedptr 2025-07-02 19:19:00 +02:00
Janis f4623d1205 fixed can_transmute/SmallBox::is_inline 2025-07-02 19:18:41 +02:00
Janis 56faa52d0d xorshift64star 2025-07-02 18:46:02 +02:00
Janis 119b49e20d random small things:
Send wrapper
available_parallelism
2025-07-02 18:07:25 +02:00
Janis 2fabc61378 smallbox 2025-07-02 18:04:21 +02:00
Janis 7eca9adde5 initial commit 2025-07-02 17:42:01 +02:00