Skip to content

Commit

Permalink
Cache eviction (#103)
Browse files Browse the repository at this point in the history
* fix: clear graphics caches when unloading projects

* fix: set max memory to 4 GiB in web builds instead of 1 GiB
  • Loading branch information
white-axe authored Feb 13, 2024
1 parent e29fb4d commit 4c714d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ rustflags = [
"--cfg=web_sys_unstable_apis",
"-C",
"target-feature=+atomics,+bulk-memory,+mutable-globals",
"-C",
"link-arg=--max-memory=4294967296",
"-Z",
"threads=8",
]
2 changes: 2 additions & 0 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ impl<'res> UpdateState<'res> {
self.edit_windows.clean(|w| !w.requires_filesystem());
self.edit_tabs.clean(|t| !t.requires_filesystem());
self.audio.clear_sinks(); // audio loads files borrows from the filesystem. unloading while they are playing is a crash
self.graphics.atlas_loader.clear();
self.graphics.texture_loader.clear();
self.filesystem.unload_project();
*self.project_config = None;
self.data.unload();
Expand Down

0 comments on commit 4c714d5

Please sign in to comment.