mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Replace arena allocator
Use slab instead of the deprecated vec_arena, both of which appear to use the same Vec based storage of an enum that's either the entry or an index to the next free slot.
This commit is contained in:
parent
b5138843fe
commit
379e645c80
3 changed files with 3 additions and 3 deletions
|
@ -34,7 +34,7 @@ scoped-tls-hkt = "0.1"
|
|||
static_assertions = "1.1"
|
||||
strum = "0.20"
|
||||
strum_macros = "0.20"
|
||||
vec-arena = "1.0.0"
|
||||
slab = "0.4.3"
|
||||
pin-weak = "1"
|
||||
auto_enums = "0.7"
|
||||
stretch = "0.3.2"
|
||||
|
|
|
@ -93,7 +93,7 @@ impl<T> CachedGraphicsData<T> {
|
|||
/// The RenderingCache, in combination with CachedGraphicsData, allows backends to store data that's either
|
||||
/// intensive to compute or has bad CPU locality. Backends typically keep a RenderingCache instance and use
|
||||
/// the item's cached_rendering_data() integer as index in the vec_arena::Arena.
|
||||
pub type RenderingCache<T> = vec_arena::Arena<CachedGraphicsData<T>>;
|
||||
pub type RenderingCache<T> = slab::Slab<CachedGraphicsData<T>>;
|
||||
|
||||
/// FontRequest collects all the developer-configurable properties for fonts, such as family, weight, etc.
|
||||
/// It is submitted as a request to the platform font system (i.e. CoreText on macOS) and in exchange the
|
||||
|
|
|
@ -162,7 +162,7 @@ struct ActiveTimer {
|
|||
/// determining the nearest timeout.
|
||||
#[derive(Default)]
|
||||
pub struct TimerList {
|
||||
timers: vec_arena::Arena<TimerData>,
|
||||
timers: slab::Slab<TimerData>,
|
||||
active_timers: Vec<ActiveTimer>,
|
||||
/// If a callback is currently running, this is the id of the currently running callback
|
||||
callback_active: Option<usize>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue