mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-20 20:48:06 +00:00
terminal/kitty: evict without scratch allocation
Track each image's placement count in its existing metadata. This lets us use constant-time usage checks (rather than scans) during eviction. Select the best candidate directly from storage on each eviction, preserving the existing priority order: unused status, transient hint, generation, then ID. Since eviction no longer allocates, it can't fail, so callers no longer need to handle out-of-memory conditions.
This commit is contained in:
@@ -460,7 +460,7 @@ pub fn changeConfig(self: *Termio, td: *ThreadData, config: *DerivedConfig) !voi
|
||||
};
|
||||
|
||||
// Set the image limits
|
||||
try self.terminal.setKittyGraphicsSizeLimit(self.alloc, config.image_storage_limit);
|
||||
self.terminal.setKittyGraphicsSizeLimit(self.alloc, config.image_storage_limit);
|
||||
self.terminal.setKittyGraphicsLoadingLimits(.allWithTempDir(global.tmpDirPath()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user