Comments (6)
As in you want upstream to expose RawTable?
from linked-hash-map.
More like having std
itself provide LinkedHashMap
instead of hacking on top of it as this crate currently does.
from linked-hash-map.
What I want to do here is define RawTable
as:
struct RawTable<K, V, A = ()> {
capacity: usize,
size: usize,
hashes: Unique<u64>, // dynamic allocation of `cap` `u64`s | `cap` `K`s | `cap` `V`s | `cap` `A`s
aug: A, // used to store the head/tail indices for the linked version
marker: marker::PhantomData<(K, V)>,
}
and then
struct Link {
next: usize,
prev: usize,
}
pub struct LinkedHashMap<K, V> {
table: RawTable<K, V, Link>,
...
}
This will let us remove the extra key/value indirection in the current impl along with the dummy node, though the performance implications remain to be determined.
from linked-hash-map.
Forking std's impl seems more viable, honestly.
from linked-hash-map.
I think we should look into this, even if it involves maintaining an internal copy of RawTable
for the time being.
CC @carllerche.
from linked-hash-map.
To follow up, I extracted the hash table as a standalone library that runs on stable Rust. https://github.com/carllerche/hash-table
from linked-hash-map.
Related Issues (20)
- stack overflow at map.into_iter.clone() HOT 1
- Invalid link for documentation.
- miri test failure
- Missing or_default method HOT 1
- Implement `SerializeAs<_>` trait
- Memory leak with LinkedHashMap::insert HOT 10
- Inserting a existing key will change the order of keys HOT 2
- Maintained alternative: https://github.com/kyren/hashlink
- Release using serde 0.8.0 HOT 2
- Track value instead of insertion order
- Remove PartialEq::ne implementation HOT 2
- Lifetime issue with linked_hash_map iter_mut where there is none with hash_map iter_mut HOT 3
- Add values_mut
- upgrade to serde 1.0 HOT 3
- serde macros fail HOT 1
- Deprecate this crate in favor of indexmap? HOT 3
- Maps with the same entries but different orders do not compare equal HOT 1
- Why back needs mutable reference?
- Audit the sentinel node for Unsafe Code Guidelines Violations HOT 10
- feature "clippy" broken ( breaks build with --all-features ) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linked-hash-map.