-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds a Slab::get_mut method, which takes a `&mut self`, and thus is able to get a mutable reference to an element without actually using any synchronization structures. This is a similar concept to `UnsafeCell::get_mut`, and may be useful for cases such as: - A sharded `Slab` wrapped in a `RwLock`, such that hot path operations are done through read guards, and rarer and complex operations are done through write guards. - Any other situation where code has both parallel and serial section, such as in fork-join systems. - Gradually converting single-threaded systems to parallelizable systems. The doc comment adds a test that helps ensure basic functionality works. `test_println!` comments are not added since, as this doesn't actually manipulate any internal structures except the user-provided types, they don't seem that useful in this case.
- Loading branch information
1 parent
e540cdb
commit 6938484
Showing
5 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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