Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree_fuzz: fix false positive #1906

Merged
merged 2 commits into from
May 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/lsm/tree_fuzz.zig
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,14 @@ const Model = struct {
table_usage: TableUsage,

fn init(table_usage: TableUsage) !Model {
const model_node_count = std.math.divCeil(
u32,
events_max * @sizeOf(Value),
NodePool.node_size,
) catch unreachable;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fyi we have a stdx.div_ceil that doesn't return an error. (It asserts that the denominator is nonzero.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh, I had a vague recollection of that, but grepped for divCeil which didtt' help 🤣

sentientwaffle marked this conversation as resolved.
Show resolved Hide resolved
return .{
.array = try Array.init(allocator),
.node_pool = try NodePool.init(allocator, 1_000),
.node_pool = try NodePool.init(allocator, model_node_count),
.table_usage = table_usage,
};
}
Expand Down
Loading