Skip to content

Commit

Permalink
Merge pull request #41 from isamaru/Issue33_Pickle_MemLeak
Browse files Browse the repository at this point in the history
Issue33: pickle mem leak
  • Loading branch information
mpenkov authored Aug 16, 2020
2 parents 2bc58f4 + b5ddcaf commit 2cff8cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cbounter/cms_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ CMS_VARIANT(_reduce)(CMS_TYPE *self)
return NULL;
PyList_SetItem(state_table, self->depth, hll);
PyList_SetItem(state_table, self->depth + 1, Py_BuildValue("i", self->total));
return Py_BuildValue("(OOO)", Py_TYPE(self), args, state_table);
return Py_BuildValue("(ONN)", Py_TYPE(self), args, state_table);
}

/* De-serialization function for pickling. */
Expand Down
4 changes: 2 additions & 2 deletions cbounter/ht_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,9 @@ HT_VARIANT(_reduce)(HT_TYPE *self)

PyObject * hll_row = PyByteArray_FromStringAndSize(self->hll.registers, self->hll.size);

PyObject *state = Py_BuildValue("(LLILOOOO)",
PyObject *state = Py_BuildValue("(LLILNNNN)",
self->total, self->str_allocated, self->size, self->max_prune, hashtable_list, strings_row, histo_row, hll_row);
return Py_BuildValue("(OOO)", Py_TYPE(self), args, state);
return Py_BuildValue("(ONN)", Py_TYPE(self), args, state);
}

/* De-serialization function for pickling. */
Expand Down

0 comments on commit 2cff8cf

Please sign in to comment.