Age | Commit message (Collapse) | Author |
|
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
|
|
Include the type name in the error message so you know what to look for.
|
|
This commit replaces GothamState's internal HashMap
with a BTreeMap to improve performance.
OpState/GothamState keys by TypeId which is essentially
an opaque u64. For small sets of integer keys BTreeMap
outperforms HashMap mainly since it removes the hashing
overhead and Eq/Comp on integer-like types is very cheap,
it should also have a smaller memory footprint.
We only use ~30 unique types and thus ~30 unique keys to
access OpState, so the keyset is small and immutable
throughout the life of a JsRuntime, there's no meaningful
churn in keys added/removed.
|
|
|
|
|
|
This commit adds a test case to core/gotham_state.rs that shows
that type aliases can't be used reliably. Instead wrapper types
should be used.
|
|
|
|
Provides a concrete state type that can be dynamically added. This is necessary for op crates.
* renames BasicState to OpState
* async ops take `Rc<RefCell<OpState>>`
* sync ops take `&mut OpState`
* removes `OpRegistry`, `OpRouter` traits
* `get_error_class_fn` moved to OpState
* ResourceTable moved to OpState
|