diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-21 06:06:40 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-21 21:44:00 +0200 |
commit | a2dcc642c1737721bafe54605c7826fa08d18f47 (patch) | |
tree | 655b96d46815d93259b12dccc8acad293437db41 /src/video_core/buffer_cache/buffer_cache.h | |
parent | buffer_cache: Use boost::container::small_vector for maps in range (diff) | |
download | yuzu-a2dcc642c1737721bafe54605c7826fa08d18f47.tar yuzu-a2dcc642c1737721bafe54605c7826fa08d18f47.tar.gz yuzu-a2dcc642c1737721bafe54605c7826fa08d18f47.tar.bz2 yuzu-a2dcc642c1737721bafe54605c7826fa08d18f47.tar.lz yuzu-a2dcc642c1737721bafe54605c7826fa08d18f47.tar.xz yuzu-a2dcc642c1737721bafe54605c7826fa08d18f47.tar.zst yuzu-a2dcc642c1737721bafe54605c7826fa08d18f47.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/buffer_cache/buffer_cache.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 0c8500c04..2262259c7 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -284,8 +284,8 @@ protected: MarkRegionAsWritten(new_map.start, new_map.end - 1); new_map.is_written = true; } - // Temporary hack, leaks memory and it's not cache local - MapInterval* const storage = &mapped_addresses_storage.emplace_back(new_map); + MapInterval* const storage = mapped_addresses_allocator.Allocate(); + *storage = new_map; mapped_addresses.insert(*storage); return storage; } @@ -313,6 +313,7 @@ protected: const auto it = mapped_addresses.find(*map); ASSERT(it != mapped_addresses.end()); mapped_addresses.erase(it); + mapped_addresses_allocator.Release(map); } private: @@ -577,7 +578,7 @@ private: u64 buffer_offset = 0; u64 buffer_offset_base = 0; - std::list<MapInterval> mapped_addresses_storage; // Temporary hack + MapIntervalAllocator mapped_addresses_allocator; boost::intrusive::set<MapInterval, boost::intrusive::compare<MapIntervalCompare>> mapped_addresses; |