Closed brianfromoregon closed 2 months ago
I'm sure it's a little confusing to see the #include "../zlib/zlib.h" in that linked source file. I removed that line in my copy. My zlib is coming from conda.
Side note on the code: you should not put anything with side effects, i.e. anything that needs to execute, inside an assert()
. It is common for assert()
's to be active while testing, but then defined away in the production compile. E.g., your:
assert(inflateInit2(&inflator, 15 + 16) == 0);
should be:
int ret = inflateInit2(&inflator, 15 + 16);
assert(ret == Z_OK);
Great spot! Yeah that's what is going on. I'll close this.
Is it? You tested it with the asserts fixed?
Yep :)
Hi
I am using zlib 1.2.13. The usage code is here (I am a user but not the author): https://github.com/Razvi99/fastCSV/blob/master/lib/fastCSV/gzipReadBuffer.hpp#L95
With -O0 the very first call to inflate returns Z_OK. The fastcsv code reads the entire file (a few GB) and all is well. With -O2 the very first call to inflate returns Z_STREAM_END and the fastcsv code goes in a infloop. Everything else is the same, just running cmake with release vs. debug build. Is this expected? Is there a known issue fixed in latest 1.3.1?
Thanks Brian