Skip to content

Commit

Permalink
Allocation checks not required for R_alloc (see Writing R Extensions)
Browse files Browse the repository at this point in the history
  • Loading branch information
louisaslett committed Oct 2, 2024
1 parent a6015ba commit 047287b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/R_MatAndMul.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,6 @@ void MatAndMul_A(double* restrict res,
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);

double *res_perth = (double*) R_alloc(r*(nthreads+1), sizeof(double));
if (res_perth == NULL) {
printf("Failed allocating res_perth!\n");
exit(1);
}

size_t num_perth = c/nthreads;
size_t rag_end = c%nthreads;
Expand Down
4 changes: 0 additions & 4 deletions src/R_MatAndMulBtwVar.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,6 @@ void MatAndMulBtwVar_A(double* restrict res,
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);

double *res_perth = (double*) R_alloc(r*(nthreads+1), sizeof(double));
if (res_perth == NULL) {
printf("Failed allocating res_perth!\n");
exit(1);
}

size_t num_perth = c/nthreads;
size_t rag_end = c%nthreads;
Expand Down

0 comments on commit 047287b

Please sign in to comment.