Skip to content
Snippets Groups Projects
Commit 71173c0e authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

allocate the cell_buff arrays aligned, as gcc assumes they will be and emits...

allocate the cell_buff arrays aligned, as gcc assumes they will be and emits aligned read/writes in memswap.
parent d3382db2
No related branches found
No related tags found
1 merge request!294Buffered cell_split
...@@ -1481,8 +1481,8 @@ void space_split_recursive(struct space *s, struct cell *c, ...@@ -1481,8 +1481,8 @@ void space_split_recursive(struct space *s, struct cell *c,
const int allocate_buffer = (buff == NULL && gbuff == NULL); const int allocate_buffer = (buff == NULL && gbuff == NULL);
if (allocate_buffer) { if (allocate_buffer) {
if (count > 0) { if (count > 0) {
if ((buff = (struct cell_buff *)malloc(sizeof(struct cell_buff) * if (posix_memalign((void *)&buff, SWIFT_STRUCT_ALIGNMENT,
count)) == NULL) sizeof(struct cell_buff) * count) != 0)
error("Failed to allocate temporary indices."); error("Failed to allocate temporary indices.");
for (int k = 0; k < count; k++) { for (int k = 0; k < count; k++) {
buff[k].x[0] = parts[k].x[0]; buff[k].x[0] = parts[k].x[0];
...@@ -1491,8 +1491,8 @@ void space_split_recursive(struct space *s, struct cell *c, ...@@ -1491,8 +1491,8 @@ void space_split_recursive(struct space *s, struct cell *c,
} }
} }
if (gcount > 0) { if (gcount > 0) {
if ((gbuff = (struct cell_buff *)malloc(sizeof(struct cell_buff) * if (posix_memalign((void *)&gbuff, SWIFT_STRUCT_ALIGNMENT,
gcount)) == NULL) sizeof(struct cell_buff) * gcount) != 0)
error("Failed to allocate temporary indices."); error("Failed to allocate temporary indices.");
for (int k = 0; k < gcount; k++) { for (int k = 0; k < gcount; k++) {
gbuff[k].x[0] = gparts[k].x[0]; gbuff[k].x[0] = gparts[k].x[0];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment