Skip to content

Commit c86e7a1

Browse files
committed
Fix gridlink malloc failure error message
1 parent d4e1af1 commit c86e7a1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

utils/gridlink_impl.c.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ struct cell_pair_DOUBLE * generate_cell_pairs_DOUBLE(struct cellarray_DOUBLE *la
436436
XRETURN(all_cell_pairs != NULL, NULL,
437437
"Error: Could not allocate memory for storing all the cell pairs. "
438438
"Reducing bin refine factors might help. Requested for %"PRId64" elements "
439-
"with each element of size %zu bytes\n", max_num_cell_pairs, sizeof(all_cell_pairs));
439+
"with each element of size %zu bytes\n", max_num_cell_pairs, sizeof(*all_cell_pairs));
440440

441441
for(int64_t icell=0;icell<totncells;icell++) {
442442
struct cellarray_DOUBLE *first = &(lattice1[icell]);

utils/gridlink_mocks_impl.c.src

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ struct cell_pair_DOUBLE * generate_cell_pairs_mocks_DOUBLE(struct cellarray_mock
438438
XRETURN(all_cell_pairs != NULL, NULL,
439439
"Error: Could not allocate memory for storing all the cell pairs. "
440440
"Reducing bin refine factors might help. Requested for %"PRId64" elements "
441-
"with each element of size %zu bytes\n", max_num_cell_pairs, sizeof(all_cell_pairs));
441+
"with each element of size %zu bytes\n", max_num_cell_pairs, sizeof(*all_cell_pairs));
442442

443443
for(int64_t icell=0;icell<totncells;icell++) {
444444
struct cellarray_mocks_DOUBLE *first = &(lattice1[icell]);
@@ -928,7 +928,7 @@ struct cell_pair_DOUBLE * generate_cell_pairs_mocks_theta_dec_DOUBLE(cellarray_m
928928
XRETURN(all_cell_pairs != NULL, NULL,
929929
"Error: Could not allocate memory for storing all the cell pairs. "
930930
"Reducing bin refine factors might help. Requested for %"PRId64" elements "
931-
"with each element of size %zu bytes\n", max_num_cell_pairs, sizeof(all_cell_pairs));
931+
"with each element of size %zu bytes\n", max_num_cell_pairs, sizeof(*all_cell_pairs));
932932

933933
/* This ngb is a trivial function. Loop over +- idec from every cell. And that's a neighbour cell */
934934
for(int64_t icell=0;icell<totncells;icell++) {
@@ -1522,7 +1522,7 @@ struct cell_pair_DOUBLE * generate_cell_pairs_mocks_theta_ra_dec_DOUBLE(cellarra
15221522
XRETURN(all_cell_pairs != NULL, NULL,
15231523
"Error: Could not allocate memory for storing all the cell pairs. "
15241524
"Reducing bin refine factors might help. Requested for %"PRId64" elements "
1525-
"with each element of size %zu bytes\n", max_num_cell_pairs, sizeof(all_cell_pairs));
1525+
"with each element of size %zu bytes\n", max_num_cell_pairs, sizeof(*all_cell_pairs));
15261526

15271527
const DOUBLE ra_diff = ra_max - ra_min;
15281528
const DOUBLE inv_ra_diff = 1.0/ra_diff;

0 commit comments

Comments
 (0)