Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
fd51df93
Commit
fd51df93
authored
8 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
use memswap in cell_split.
parent
95ef2ec0
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!284
Space rebuild
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cell.c
+6
-15
6 additions, 15 deletions
src/cell.c
with
6 additions
and
15 deletions
src/cell.c
+
6
−
15
View file @
fd51df93
...
...
@@ -52,6 +52,7 @@
#include
"gravity.h"
#include
"hydro.h"
#include
"hydro_properties.h"
#include
"memswap.h"
#include
"minmax.h"
#include
"scheduler.h"
#include
"space.h"
...
...
@@ -513,15 +514,9 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, int *buff) {
j
++
;
bucket_count
[
bid
]
++
;
}
struct
part
temp_part
=
parts
[
j
];
struct
xpart
temp_xpart
=
xparts
[
j
];
int
temp_buff
=
buff
[
j
];
parts
[
j
]
=
part
;
xparts
[
j
]
=
xpart
;
buff
[
j
]
=
bid
;
part
=
temp_part
;
xpart
=
temp_xpart
;
bid
=
temp_buff
;
memswap
(
&
parts
[
j
],
&
part
,
sizeof
(
struct
part
));
memswap
(
&
xparts
[
j
],
&
xpart
,
sizeof
(
struct
xpart
));
memswap
(
&
buff
[
j
],
&
bid
,
sizeof
(
int
));
}
parts
[
k
]
=
part
;
xparts
[
k
]
=
xpart
;
...
...
@@ -602,12 +597,8 @@ void cell_split(struct cell *c, ptrdiff_t parts_offset, int *buff) {
j
++
;
bucket_count
[
bid
]
++
;
}
struct
gpart
temp_gpart
=
gparts
[
j
];
int
temp_buff
=
buff
[
j
];
gparts
[
j
]
=
gpart
;
buff
[
j
]
=
bid
;
gpart
=
temp_gpart
;
bid
=
temp_buff
;
memswap
(
&
gparts
[
j
],
&
gpart
,
sizeof
(
struct
gpart
));
memswap
(
&
buff
[
j
],
&
bid
,
sizeof
(
int
));
}
gparts
[
k
]
=
gpart
;
buff
[
k
]
=
bid
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment