Skip to content

Commit

Permalink
Last one in fwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed Jul 17, 2024
1 parent 5ea35ee commit ac6620b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,9 @@ void fwriteMain(fwriteMainArgs args)
int failed_write = 0; // same. could use +ve and -ve in the same code but separate it out to trace Solaris problem, #3931

#ifndef NOZLIB
z_stream thread_streams[nth];
z_stream *thread_streams = (z_stream *)malloc(nth * sizeof(z_stream));
if (!thread_streams)
STOP(_("Failed to allocated %d bytes for '%s'."), (int)(nth * sizeof(z_stream)), "thread_streams");
// VLA on stack should be fine for nth structs; in zlib v1.2.11 sizeof(struct)==112 on 64bit
// not declared inside the parallel region because solaris appears to move the struct in
// memory when the #pragma omp for is entered, which causes zlib's internal self reference
Expand Down Expand Up @@ -988,6 +990,7 @@ void fwriteMain(fwriteMainArgs args)
}
free(buffPool);
#ifndef NOZLIB
free(thread_streams);
free(zbuffPool);
#endif

Expand Down

0 comments on commit ac6620b

Please sign in to comment.