Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
fcbab9ea
Commit
fcbab9ea
authored
Nov 07, 2016
by
Pedro Gonnet
Browse files
make space_recycle non-blocking and don't clear the cells before returning them.
parent
3bdd372a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/space.c
View file @
fcbab9ea
...
...
@@ -1602,25 +1602,15 @@ void space_split_mapper(void *map_data, int num_cells, void *extra_data) {
*/
void
space_recycle
(
struct
space
*
s
,
struct
cell
*
c
)
{
/* Lock the space. */
lock_lock
(
&
s
->
lock
);
/* Clear the cell. */
if
(
lock_destroy
(
&
c
->
lock
)
!=
0
)
error
(
"Failed to destroy spinlock."
);
/* Clear this cell's sort arrays. */
if
(
c
->
sort
!=
NULL
)
free
(
c
->
sort
);
/* Clear the cell data. */
bzero
(
c
,
sizeof
(
struct
cell
));
/* Hook this cell into the buffer. */
c
->
next
=
s
->
cells_sub
;
s
->
cells_sub
=
c
;
s
->
tot_cells
-=
1
;
/* Unlock the space. */
lock_unlock_blind
(
&
s
->
lock
);
c
->
next
=
atomic_swap
(
&
s
->
cells_sub
,
c
);
atomic_dec
(
&
s
->
tot_cells
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment