Skip to content

Commit

Permalink
tests: Avoid calling posix_memalign with size=0
Browse files Browse the repository at this point in the history
The behavior of a call to `posix_memalign` with a size of `0` isn't
defined, and recent versions of Valgrind detect it as an error.

Signed-off-by: Matt Wozniski <[email protected]>
  • Loading branch information
godlygeek committed Feb 23, 2025
1 parent 5427828 commit 55d77a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/integration/multithreaded_extension/testext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ allocate_memory()
{
unsigned long* buffers[NUM_BUFFERS];
for (int i=0; i < NUM_BUFFERS; ++i) {
int ret = posix_memalign((void**)buffers+i, sizeof(void*), sizeof(void*)*i);
int ret = posix_memalign((void**)buffers+i, sizeof(void*), sizeof(void*)*(i+1));
if (ret) {
buffers[i] = NULL;
break;
Expand Down

0 comments on commit 55d77a0

Please sign in to comment.