Skip to content

Commit

Permalink
Fixed a warning in Sylvan about a condition that was always true.
Browse files Browse the repository at this point in the history
 * The intention seems to be that ratio is between -10 and 10, since the
   documentation also mentions zero as a possible value.
  • Loading branch information
mlaveaux committed Mar 5, 2021
1 parent 8797774 commit d798a3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 3rd-party/sylvan/src/sylvan_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ sylvan_set_sizes(size_t min_tablesize, size_t max_tablesize, size_t min_cachesiz
void
sylvan_set_limits(size_t memorycap, int table_ratio, int initial_ratio)
{
if (table_ratio > 10 && table_ratio < 10) {
fprintf(stderr, "sylvan_set_limits: table_ratio unreasonable (between -10 and 10)\n");
if (table_ratio < -10 || table_ratio > 10) {
fprintf(stderr, "sylvan_set_limits: table_ratio unreasonable (should be between -10 and 10)\n");
exit(1);
}

Expand Down

2 comments on commit d798a3e

@tneele
Copy link
Member

@tneele tneele commented on d798a3e Mar 6, 2021

Choose a reason for hiding this comment

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

I think it's helpful if you submit this change and 124dbab upstream at https://github.com/trolando/sylvan.

@mlaveaux
Copy link
Member Author

Choose a reason for hiding this comment

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

I have opened a pull request upstream for this change. The fix applied in 124dbab was apparently already fixed upstream. We might have to think about how we are going to integrate upstream changes effectively.

Please sign in to comment.