Log if element arena allocation is >80%
We recently doubled the size of the `ELEMENT_ARENA` after someone ran into a panic due to the arena running out of space. This adds some logging so that we can hopefully develop a better understanding of when the element area's allocation is elevated. Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
parent
bd6197eb2f
commit
18f5752f04
2 changed files with 15 additions and 1 deletions
|
@ -44,6 +44,14 @@ impl Arena {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.offset as usize - self.start as usize
|
||||
}
|
||||
|
||||
pub fn capacity(&self) -> usize {
|
||||
self.end as usize - self.start as usize
|
||||
}
|
||||
|
||||
pub fn clear(&mut self) {
|
||||
self.valid.set(false);
|
||||
self.valid = Rc::new(Cell::new(true));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue