From c22d54c5d95f4d23629484579414387b0c7503ee Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 6 Apr 2025 20:00:00 -0400 Subject: [SharedCache] Replace write log with callback registration for reapplying slide info This improves performance by ~10x with the only real issue being a copy of the cache entry existing for each weak ref. Also fixes - Some old TODO's that are no longer relevant - Some function signatures not being const - FileAccessorCache not evicting enough accessors to fit under an adjusted cache size - Added a warning if we are over the global cache size in view initialization - Logger name not having a `.` in `SlideInfoProcessor::SlideInfoProcessor` - Re-added the accessor dirty check before applying slide info to fix https://github.com/Vector35/binaryninja-api/issues/6570 --- view/sharedcache/core/MappedFileAccessor.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'view/sharedcache/core/MappedFileAccessor.h') diff --git a/view/sharedcache/core/MappedFileAccessor.h b/view/sharedcache/core/MappedFileAccessor.h index 2bbf4ba9..a63d8506 100644 --- a/view/sharedcache/core/MappedFileAccessor.h +++ b/view/sharedcache/core/MappedFileAccessor.h @@ -70,23 +70,23 @@ public: std::string ReadNullTermString(size_t address, size_t maxLength = -1) const; - uint8_t ReadUInt8(size_t address); + uint8_t ReadUInt8(size_t address) const; - int8_t ReadInt8(size_t address); + int8_t ReadInt8(size_t address) const; - uint16_t ReadUInt16(size_t address); + uint16_t ReadUInt16(size_t address) const; - int16_t ReadInt16(size_t address); + int16_t ReadInt16(size_t address) const; - uint32_t ReadUInt32(size_t address); + uint32_t ReadUInt32(size_t address) const; - int32_t ReadInt32(size_t address); + int32_t ReadInt32(size_t address) const; - uint64_t ReadUInt64(size_t address); + uint64_t ReadUInt64(size_t address) const; - int64_t ReadInt64(size_t address); + int64_t ReadInt64(size_t address) const; - BinaryNinja::DataBuffer ReadBuffer(size_t addr, size_t length); + BinaryNinja::DataBuffer ReadBuffer(size_t addr, size_t length) const; // Returns a range of pointers within the mapped memory region corresponding to // {addr, length}. @@ -99,5 +99,5 @@ public: void Read(void* dest, size_t addr, size_t length) const; template - T Read(size_t address); + T Read(size_t address) const; }; -- cgit v1.3.1