use a boxed array insted of a vec
This commit is contained in:
parent
a8b40e6101
commit
c547773570
1 changed files with 2 additions and 2 deletions
|
|
@ -18,7 +18,7 @@ pub trait Grid<I, V> {
|
||||||
pub struct Flut<T> {
|
pub struct Flut<T> {
|
||||||
size_x: usize,
|
size_x: usize,
|
||||||
size_y: usize,
|
size_y: usize,
|
||||||
cells: SyncUnsafeCell<Vec<T>>,
|
cells: SyncUnsafeCell<Box<[T]>>,
|
||||||
last_hash: SyncUnsafeCell<u64>,
|
last_hash: SyncUnsafeCell<u64>,
|
||||||
jpgbuf: RwLock<Vec<u8>>,
|
jpgbuf: RwLock<Vec<u8>>,
|
||||||
}
|
}
|
||||||
|
|
@ -32,7 +32,7 @@ impl<T: Clone> Flut<T> {
|
||||||
Flut {
|
Flut {
|
||||||
size_x,
|
size_x,
|
||||||
size_y,
|
size_y,
|
||||||
cells: vec.into(),
|
cells: vec.into_boxed_slice().into(),
|
||||||
last_hash: 0.into(),
|
last_hash: 0.into(),
|
||||||
jpgbuf: RwLock::new(Vec::new()),
|
jpgbuf: RwLock::new(Vec::new()),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue