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:
Simon Hausmann 2021-05-12 11:25:00 +02:00
parent b5138843fe
commit 379e645c80
3 changed files with 3 additions and 3 deletions

View file

@ -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"

View file

@ -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

View file

@ -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>,