pub fn setEstimatedTotalItems(n: Node, count: usize) void n: Nodecount: usize352
353
354
355
356
357
358 pub fn setEstimatedTotalItems(n: Node, count: usize) void {
const index = n.index.unwrap() orelse return;
const storage = storageByIndex(index);
// Avoid u32 max int which is used to indicate a special state.
const saturated_total_count = @min(std.math.maxInt(u32) - 1, count);
@atomicStore(u32, &storage.estimated_total_count, saturated_total_count, .monotonic);
}
Thread-safe. 0 means unknown.