Skip to content

Commit

Permalink
Merge pull request #1486 from opencog/grow-table
Browse files Browse the repository at this point in the history
Bugfix tracon table size management.
  • Loading branch information
linas authored Apr 7, 2024
2 parents f39cc7e + e369e48 commit b60bb59
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Version 5.12.5 (XXX 2024)
* Nothing yet!
* Bugfix tracon table size management. #1486

Version 5.12.4 (28 March 2024)
* Minor English dict fixes. #1470
Expand Down
3 changes: 2 additions & 1 deletion link-grammar/string-id.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ static void grow_table(String_id *ss)
ss->table[p] = old.table[i];
}
}
ss->available_count = MAX_STRING_SET_TABLE_SIZE(ss->size);
ss->available_count = MAX_STRING_SET_TABLE_SIZE(ss->size) -
MAX_STRING_SET_TABLE_SIZE(old.size);

/* printf("growing from %zu to %zu\n", old.size, ss->size); */
free(old.table);
Expand Down
3 changes: 2 additions & 1 deletion link-grammar/string-set.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ static void grow_table(String_set *ss)
ss->table[p] = old.table[i];
}
}
ss->available_count = MAX_STRING_SET_TABLE_SIZE(ss->size);
ss->available_count = MAX_STRING_SET_TABLE_SIZE(ss->size) -
MAX_STRING_SET_TABLE_SIZE(old.size);

/* printf("growing from %zu to %zu\n", old.size, ss->size); */
free(old.table);
Expand Down
3 changes: 2 additions & 1 deletion link-grammar/tracon-set.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ static void grow_table(Tracon_set *ss)
ss->table[p] = old.table[i];
}
}
ss->available_count = MAX_STRING_SET_TABLE_SIZE(ss->size);
ss->available_count = MAX_STRING_SET_TABLE_SIZE(ss->size) -
MAX_STRING_SET_TABLE_SIZE(old.size);

/* printf("growing from %zu to %zu\n", old.size, ss->size); */
PRT_STAT(fp_count = fp_count_save);
Expand Down

0 comments on commit b60bb59

Please sign in to comment.