summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-13 09:04:46 +0300
committerPaul Buetow <paul@buetow.org>2026-07-13 09:04:46 +0300
commit48aa1b3cdbf27be2e016e8b532687226f9249043 (patch)
tree89d3ceab9194d755aeb3219dda5c84cbfe8370f1 /meson.build
parent89727590e718d3628a0847689182e896df646b8a (diff)
responsive: async loader, texture cache LRU, prefetch, tests (it0)
M3 (task it0): responsive + prefetch. - src/loader/loader.{c,h}: loader_load_async/_finish wrap the sync loader_load in a GTask worker; the task's source object is the GFile so the finish callback can check it against navigator.current (last-write-wins). - src/texturecache.{c,h}: bounded LRU (cap 4) of GFile->GdkTexture, hash+GQueue O(1) get/put, entry owns the key (no double-unref), evicts LRU on overflow. - src/window.c: async visible load (cancel-then-recreate single GCancellable); cache hit -> show+prefetch, miss -> async load; last-write-wins guard (g_file_equal(current, loaded)) before showing; prefetch next/prev into the cache via a separate prefetch cancellable (cancelled each round). Finish callbacks hold a ref on the window (released in the callback) so they never deref a freed window; dispose cancels both cancellables. - tests: unit test_texturecache (LRU evict/order/replace/miss), integration test_responsive_nav (10 rapid next -> last-write-wins). M1/M2 tests updated to pump the main loop (loads are now async) + drain_main before exit. - meson: texturecache in libggae; GIO_USE_VFS=local in fixtures_env. Fixed: texturecache double-unref (key ownership), async-callback UAF (window ref in callback data + drain in tests), a test g_build_filename leak. Sub-agent review issues addressed (dispose + cache-hit cancel in-flight loads).
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build1
1 files changed, 1 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 6fcd4cc..f27b935 100644
--- a/meson.build
+++ b/meson.build
@@ -59,6 +59,7 @@ ggaze_lib = static_library('ggaze',
'src/viewer.c',
'src/navigator.c',
'src/shortcuts.c',
+ 'src/texturecache.c',
'src/loader/loader.c',
'src/loader/detect.c',
'src/loader/backends/pixbuf.c',