mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-04 10:24:56 -04:00
fix(test): properly count successful reallocations in TrackingAllocator
This commit is contained in:
1 parent
535128da71
commit
4d6d8d9a83
1 file changed
+2
-2
+2
-2
@@ -501,7 +501,7 @@ pub const TrackingAllocator = struct {
|
||||
defer self.mutex.unlock();
|
||||
|
||||
const result = self.parent_allocator.rawResize(old_mem, alignment, new_len, ra);
|
||||
self.reallocation_count += 1; // TODO: only if result is not null?
|
||||
if (result) self.reallocation_count += 1;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ pub const TrackingAllocator = struct {
|
||||
defer self.mutex.unlock();
|
||||
|
||||
const result = self.parent_allocator.rawRemap(memory, alignment, new_len, ret_addr);
|
||||
self.reallocation_count += 1; // TODO: only if result is not null?
|
||||
if (result != null) self.reallocation_count += 1;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user