mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
Address feedback.
This commit is contained in:
1 parent
c8a06d40c9
commit
449f80b74f
2 files changed
+8
-8
No files matched your search
@@ -278,7 +278,7 @@ bool VulkanDeviceAllocator::AllocateFromSlab(Slab &slab, size_t &start, size_t b
|
||||
|
||||
// Remember the size so we can free.
|
||||
slab.allocSizes[start] = blocks;
|
||||
slab.tags[start] = { tag, (float)time_now_d(), 0.0f };
|
||||
slab.tags[start] = { tag, time_now_d(), 0.0 };
|
||||
slab.totalUsage += blocks;
|
||||
return true;
|
||||
}
|
||||
@@ -436,15 +436,15 @@ bool VulkanDeviceAllocator::AllocateSlab(VkDeviceSize minBytes, int memoryTypeIn
|
||||
}
|
||||
|
||||
void VulkanDeviceAllocator::ReportOldUsage() {
|
||||
float now = time_now_d();
|
||||
static const float OLD_AGE = 10.0f;
|
||||
double now = time_now_d();
|
||||
static const double OLD_AGE = 10.0;
|
||||
for (size_t i = 0; i < slabs_.size(); ++i) {
|
||||
const auto &slab = slabs_[i];
|
||||
|
||||
bool hasOldAllocs = false;
|
||||
for (auto it : slab.tags) {
|
||||
const auto info = it.second;
|
||||
float touchedAge = now - info.touched;
|
||||
double touchedAge = now - info.touched;
|
||||
if (touchedAge >= OLD_AGE) {
|
||||
hasOldAllocs = true;
|
||||
break;
|
||||
@@ -456,8 +456,8 @@ void VulkanDeviceAllocator::ReportOldUsage() {
|
||||
for (auto it : slab.tags) {
|
||||
const auto info = it.second;
|
||||
|
||||
float createAge = now - info.created;
|
||||
float touchedAge = now - info.touched;
|
||||
double createAge = now - info.created;
|
||||
double touchedAge = now - info.touched;
|
||||
NOTICE_LOG(G3D, " * %s (created %fs ago, used %fs ago)", info.tag.c_str(), createAge, touchedAge);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user