Expand description
Where finished icons are kept: a byte-bounded memory LRU, and a small disk cache so a restart doesn’t ask the shell again (spec §4.4). A type icon’s file name carries a hash of the file associations behind it, so changing a default app makes a new file instead of needing a notification.
Structs§
- MemCache
- Encoded PNGs by key, least recently used out first once over the cap.
Constants§
- DISK_
CAP_ BYTES - Disk kept for type icons (a few hundred small files).
- MEM_
CAP_ BYTES - Memory kept for encoded icons.
Functions§
- disk_
path <root>/ext/<px>/<kind>-<ext>.<assoc>.png. The extension is validated to[a-z0-9_+-]and the kind prefix keeps a name likeconfrom being a reserved device name on Windows.- key
- The key a finished icon is kept under (memory and, hashed into the file name, disk).
- prune
- Delete the oldest files under
rootuntil what is left is at mostcapbytes. - stable_
hash - FNV-1a over the bytes: the same answer on every toolchain, since it names files that outlive a build.