arena heads-up comment, mem_arena -> arena, used seperate arena for GUI rects

This commit is contained in:
Anton-4 2021-02-09 17:11:33 +01:00
parent 581ef916fc
commit cd8adb1d6d
5 changed files with 14 additions and 9 deletions

View file

@ -167,8 +167,11 @@ fn run_event_loop(file_path_opt: Option<&Path>) -> Result<(), Box<dyn Error>> {
let mut keyboard_modifiers = ModifiersState::empty();
// This arena is never cleared and should only be used for allocations that occur rarely
let arena = Bump::new();
let mut rects_arena = Bump::new();
// Render loop
window.request_redraw();
@ -313,9 +316,11 @@ fn run_event_loop(file_path_opt: Option<&Path>) -> Result<(), Box<dyn Error>> {
);
}
rects_arena.reset();
match draw_all_rects(
&app_model.ed_model_opt,
&arena,
&rects_arena,
&mut encoder,
&frame.view,
&gpu_device,