Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fprintf: Remove fprintf statements from volk_malloc #744

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions lib/volk_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
void* volk_malloc(size_t size, size_t alignment)
{
if ((size == 0) || (alignment == 0)) {
fprintf(stderr, "VOLK: Error allocating memory: either size or alignment is 0\n");
return NULL;
}
// Tweak size to satisfy ASAN (the GCC address sanitizer).
Expand All @@ -59,21 +58,12 @@ void* volk_malloc(size_t size, size_t alignment)
int err = posix_memalign(&ptr, alignment, size);
if (err != 0) {
ptr = NULL;
fprintf(stderr,
"VOLK: Error allocating memory "
"(posix_memalign: error %d: %s)\n",
err,
strerror(err));
}
#elif defined(_MSC_VER) || defined(__MINGW32__)
void* ptr = _aligned_malloc(size, alignment);
#else
void* ptr = aligned_alloc(alignment, size);
#endif
if (ptr == NULL) {
fprintf(stderr,
"VOLK: Error allocating memory (aligned_alloc/_aligned_malloc)\n");
}
return ptr;
}

Expand Down
Loading