Skip to content

Commit

Permalink
Natively allocate dbiIndexSet structs
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatilai committed Jun 11, 2024
1 parent cc1bdc8 commit 9a21826
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/backend/dbiset.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct dbiIndexSet_s {

dbiIndexSet dbiIndexSetNew(unsigned int sizehint)
{
dbiIndexSet set = (dbiIndexSet)xcalloc(1, sizeof(*set));
dbiIndexSet set = new dbiIndexSet_s {};
if (sizehint > 0)
dbiIndexSetGrow(set, sizehint);
return set;
Expand Down Expand Up @@ -192,8 +192,7 @@ dbiIndexSet dbiIndexSetFree(dbiIndexSet set)
{
if (set) {
free(set->recs);
memset(set, 0, sizeof(*set)); /* trash and burn */
free(set);
delete set;
}
return NULL;
}

0 comments on commit 9a21826

Please sign in to comment.