summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/VM.cpp
AgeCommit message (Collapse)Author
2025-01-15[SharedCache] Avoid copying strings on each call to VM::MappingAtAddressMark Rowe
`PageMapping` was storing the path to the file it points within. This was causing unnecessary work within `VM::MappingAtAddress` as the `PageMapping`, and thus the path, is copied into the return value. This copying was more expensive than the map lookup. The file path is now stored within a `LazyMappedFileAccessor` class that wraps the `SelfAllocatingWeakPtr`. This means the path is still available via the `PageMapping`, but it does not need to be copied as often. This includes two additional improvements / optimizations while I was touching the code in question: 1. `MMappedFileAccessor::Open` no longer performs two hash lookups when a file accessor already exists. 2. `VM::MapPages` takes the path by const reference to avoid an unnecessary copy.
2024-12-10[SharedCache] Have VM track ranges rather than pagesMark Rowe
There are typically only a few dozen mappings, while there can be millions of pages. This reduces the amount of time spent populating the mapping from region to file accessor along with the memory usage of the same.
2024-11-13Don't leak DataBuffersMark Rowe
`MMappedFileAccessor::ReadBuffer` was returning a heap-allocated `DataBuffer`, but no callers were ever deleting it. There does not appear to be any reason to heap allocate the `DataBuffer` as the type is effectively a smart pointer wrapper around `BNDataBuffer`. Switch to returning it by value instead. Additionally, `MMappedFileAccessor::ReadBuffer` was allocating a buffer, copying data into it, and then handing that allocation to the `DataBuffer` constructor. The constructor copies data into a new allocation it owns so this allocation is unnecessary and was being leaked.
2024-11-06normalize Shared Cache nameJordan Wiens
2024-11-06[SharedCache] Fix bndb save/load within projectskat
2024-11-05[SharedCache] Add project support for split dscJosh Ferrell
2024-10-23Initial commit of the alpha dyld_shared_cache view API Plugin.kat
This is an early release of our DSC processing plugin. We're still hard at work improving this feature. You should be able to just drop in a dyld_shared_cache and use the 'Shared Cache Triage' view to load and analyze images.