Commit 9dcdeb4a authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

no need to clean up linked cells as they are bzeroed before being returned in space_getcell.

parent 6979ad47
......@@ -1635,9 +1635,6 @@ void space_recycle(struct space *s, struct cell *c) {
/* Clear this cell's sort arrays. */
if (c->sort != NULL) free(c->sort);
/* Clear the cell data. */
bzero(c, sizeof(struct cell));
/* Lock the space. */
lock_lock(&s->lock);
......@@ -1671,10 +1668,7 @@ void space_recycle_list(struct space *s, struct cell *list_begin,
if (lock_destroy(&c->lock) != 0) error("Failed to destroy spinlock.");
/* Clear this cell's sort arrays. */
if (c->sort != NULL) {
free(c->sort);
c->sort = NULL;
}
if (c->sort != NULL) free(c->sort);
/* Count this cell. */
count += 1;
......@@ -1711,9 +1705,6 @@ struct cell *space_getcell(struct space *s) {
space_cellallocchunk * sizeof(struct cell)) != 0)
error("Failed to allocate more cells.");
/* Zero everything for good measure */
bzero(s->cells_sub, space_cellallocchunk * sizeof(struct cell));
/* Constructed a linked list */
for (int k = 0; k < space_cellallocchunk - 1; k++)
s->cells_sub[k].next = &s->cells_sub[k + 1];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment