mirror of
https://review.haiku-os.org/haiku
synced 2025-02-21 21:19:09 +01:00
Overcommitted caches should only have commitments equal to the number of pages they actually contain, so we should decommit whenever pages are discarded. This changes the API of VMCache::Discard to return an ssize_t of the size of pages that were discarded (or a negative error on failure.) Nothing checked the return value besides things in VMCache itself, it appears; but it apparently never fails, so that's fine. Also add asserts to Commit() that the new commitment at least encompasses all pages the cache actually contains.