summaryrefslogtreecommitdiff
path: root/ext/zlib
AgeCommit message (Collapse)Author
2021-10-19[ruby/zlib] Bump up zlib version to 2.1.1Hiroshi SHIBATA
https://github.com/ruby/zlib/commit/82e9a636a6
2021-10-15[ruby/zlib] Fix a bug that GZipReader#gets may return incomplete lineSutou Kouhei
See also: https://github.com/ruby/csv/issues/117#issuecomment-933289373 How to reproduce with x.csv.gz in the issue comment: Zlib::GzipReader.open("x.csv.gz") do |rio| rio.gets(nil, 1024) while line = rio.gets(nil, 8192) raise line unless line.valid_encoding? end end Reported by Dimitrij Denissenko. Thanks!!! https://github.com/ruby/zlib/commit/b1f182e98f
2021-10-14[ruby/zlib] Bump up zlib version to 2.1.0Hiroshi SHIBATA
https://github.com/ruby/zlib/commit/dd593acaee
2021-10-14[ruby/zlib] Bump version to v2.0.0Hiroshi SHIBATA
https://github.com/ruby/zlib/commit/434eba55ae
2021-10-05ruby tool/update-deps --fix卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/4909
2021-08-31[ruby/zlib] Don't print out warnings when finalizingNobuyoshi Nakada
https://github.com/ruby/zlib/commit/44a56d36e7
2021-08-31[ruby/zlib] Revert "Don't print out warnings when freeing."Nobuyoshi Nakada
https://github.com/ruby/zlib/commit/931aa7a272
2021-08-31[ruby/zlib] Don't print out warnings when freeing.Samuel Williams
https://github.com/ruby/zlib/commit/098c50255d
2021-07-28[ruby/zlib] Synchronize access to zstream to prevent segfault in ↵Jeremy Evans
multithreaded use I'm not sure whether this handles all multithreaded use cases, but this handles the example that crashes almost immediately and does 10,000,000 total deflates using 100 separate threads. To prevent the tests from taking forever, the committed test for this uses only 10,000 deflates across 10 separate threads, which still causes a segfault in the previous implementation almost immediately. Fixes [Bug #17803] https://github.com/ruby/zlib/commit/4b1023b3f2
2021-07-06Found library is not usable if the header is not foundNobuyoshi Nakada
2021-07-03Fix linking bundled zlibNobuyoshi Nakada
* Prefix "./" to the import library name to expanded when static linking exts. * Copy zlib shared library to the top build directory.
2021-05-04Fix -Wundef warnings for HAVE_RB_EXT_RACTOR_SAFEBenoit Daloze
* See [Feature #17752] Notes: Merged: https://github.com/ruby/ruby/pull/4428
2021-04-20[ruby/zlib] gemspec: Remove unused filesOlle Jonsson
Remove the list of executables. https://github.com/ruby/zlib/commit/6a70725b8e
2021-04-13dependency updates卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/4371
2021-03-17Adjusted indents [ci skip]Nobuyoshi Nakada
2021-03-17zlib: fix Gzip{Writer,Reader}.new fails with a O_TMPFILE fileSorah Fukumori
2021-03-09[ruby/zlib] Resume zstream if available [Bug #10961]wanabe
Notes: Merged: https://github.com/ruby/ruby/pull/4248
2021-02-10[ruby/zlib] Don't use gemspec for gem dependecyHiroshi SHIBATA
https://github.com/ruby/zlib/commit/7d3d19710f
2020-12-18zlib is ractor-safeKoichi Sasada
2020-12-04[ruby/zlib] Add Zlib::Inflate#inflate :buffer keyword argumentJeremy Evans
If a buffer keyword argument is given, it is used as the buffer, instead of creating new strings. This can result in significantly lower memory usage during inflation. Implements #19 https://github.com/ruby/zlib/commit/dac9a9b57d
2020-12-04[ruby/zlib] Allow Zlib.crc32 and .adler32 to accept IO instanceJeremy Evans
This reads from the IO in 8192 byte chunks, so you don't need to have the entire string in memory. Fixes #16 https://github.com/ruby/zlib/commit/ba9793c550
2020-12-04[ruby/zlib] Document that gets can return nil when eof? returns falseJeremy Evans
This behavior differs from File#gets. Fixes [Bug #13904] https://github.com/ruby/zlib/commit/448e41efdd
2020-12-03delete deprecated IO-like methods卜部昌平
This commit deletes {IO,ARGF,StringIO,Zib::GZipReader}#{bytes,chars,lines,codepoints}, which have been deprecated since c47c095b9740e7c19d6fdca29ab661c1089221d4. Note that String also has those methods. They are neither depreacted nor deleted because they are not aliases of counterpart each_something.
2020-11-24zlib: patches for mswin64Nobuyoshi Nakada
* cast to suppress C4267 warnings; no possible loss of data as following the comparison. * shift base address to suppress LNK4281; although /DYNAMICBASE is preferable, not sure from which version of link.exe supports it.
2020-11-24zlib: extlibs to download zlib-1.2.11Nobuyoshi Nakada
2020-09-14[ruby/zlib] Add Zlib::GzipReader.zcat for handling multiple gzip streams in ↵Jeremy Evans
gz file Most gzip tools support concatenated gz streams in a gz file. This offers a way to handle such gz files in Ruby. Fixes [Bug #9790] Fixes [Bug #11180] Fixes [Bug #14804] https://github.com/ruby/zlib/commit/e2ce56de7d
2020-08-27sed -i '/rmodule.h/d'卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3347
2020-08-27sed -i '/r_cast.h/d'卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3346
2020-08-27sed -i '\,2/extern.h,d'卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3338
2020-08-18Update the license for the default gems to dual licensesHiroshi SHIBATA
2020-05-11sed -i 's|ruby/impl|ruby/internal|'卜部昌平
To fix build failures. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-05-11sed -i s|ruby/3|ruby/impl|g卜部昌平
This shall fix compile errors. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-04-08Merge pull request #2991 from shyouhei/ruby.h卜部昌平
Split ruby.h Notes: Merged-By: shyouhei <shyouhei@ruby-lang.org>
2019-11-30[ruby/zlib] Bump version to 1.1.0Hiroshi SHIBATA
https://github.com/ruby/zlib/commit/5af77c1ee8
2019-11-05Adjust a fucntion signatureNobuyoshi Nakada
2019-10-31[ruby/zlib] Removed no longer used variablesNobuyoshi Nakada
https://github.com/ruby/zlib/commit/3e98e4cac3
2019-10-31[ruby/zlib] Fix setting mtime to zero in GzipWriterAlan Wu
Before this change, it was not possible to write out zero for the timestamp part of a Gzip file's header, as calling GzipWriter#mtime with zero was ignored. Judging from the docs for `GzipWriter#mtime=`, it should be possible to indicate that no timestamp is available by calling the method with zero. https://github.com/ruby/zlib/commit/310be39cac
2019-10-31[ruby/zlib] Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. https://github.com/ruby/zlib/commit/21711ed0ce
2019-09-29[ruby/zlib] Fix for older ruby 2.6 or earlierNobuyoshi Nakada
https://github.com/ruby/zlib/commit/00ead8cb2c
2019-09-29[ruby/zlib] Search zlib.c as a gemNobuyoshi Nakada
https://github.com/ruby/zlib/commit/8f43b264cd
2019-09-25Make rb_scan_args handle keywords more similar to Ruby methods (#2460)Jeremy Evans
Cfuncs that use rb_scan_args with the : entry suffer similar keyword argument separation issues that Ruby methods suffer if the cfuncs accept optional or variable arguments. This makes the following changes to : handling. * Treats as **kw, prompting keyword argument separation warnings if called with a positional hash. * Do not look for an option hash if empty keywords are provided. For backwards compatibility, treat an empty keyword splat as a empty mandatory positional hash argument, but emit a a warning, as this behavior will be removed in Ruby 3. The argument number check needs to be moved lower so it can correctly handle an empty positional argument being added. * If the last argument is nil and it is necessary to treat it as an option hash in order to make sure all arguments are processed, continue to treat the last argument as the option hash. Emit a warning in this case, as this behavior will be removed in Ruby 3. * If splitting the keyword hash into two hashes, issue a warning, as we will not be splitting hashes in Ruby 3. * If the keyword argument is required to fill a mandatory positional argument, continue to do so, but emit a warning as this behavior will be going away in Ruby 3. * If keyword arguments are provided and the last argument is not a hash, that indicates something wrong. This can happen if a cfunc is calling rb_scan_args multiple times, and providing arguments that were not passed to it from Ruby. Callers need to switch to the new rb_scan_args_kw function, which allows passing of whether keywords were provided. This commit fixes all warnings caused by the changes above. It switches some function calls to *_kw versions with appropriate kw_splat flags. If delegating arguments, RB_PASS_CALLED_KEYWORDS is used. If creating new arguments, RB_PASS_KEYWORDS is used if the last argument is a hash to be treated as keywords. In open_key_args in io.c, use rb_scan_args_kw. In this case, the arguments provided come from another C function, not Ruby. The last argument may or may not be a hash, so we can't set keyword argument mode. However, if it is a hash, we don't want to warn when treating it as keywords. In Ruby files, make sure to appropriately use keyword splats or literal keywords when calling Cfuncs that now issue keyword argument separation warnings through rb_scan_args. Also, make sure not to pass nil in place of an option hash. Work around Kernel#warn warnings due to problems in the Rubygems override of the method. There is an open pull request to fix these issues in Rubygems, but part of the Rubygems tests for their override fail on ruby-head due to rb_scan_args not recognizing empty keyword splats, which this commit fixes. Implementation wise, adding rb_scan_args_kw is kind of a pain, because rb_scan_args takes a variable number of arguments. In order to not duplicate all the code, the function internals need to be split into two functions taking a va_list, and to avoid passing in a ton of arguments, a single struct argument is used to handle the variables previously local to the function. Notes: Merged-By: jeremyevans <code@jeremyevans.net>
2019-08-27rb_ensure now free from ANYARGS卜部昌平
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_ensure, which also revealed many arity / type mismatches.
2019-08-27rb_rescue / rb_rescue2 now free from ANYARGS卜部昌平
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_rescue / rb_rescue2, which revealed many arity / type mismatches.
2019-07-14Include ruby/assert.h in ruby/ruby.h so that assertions can be thereNobuyoshi Nakada
2019-02-08Removed moving toplevel header since r12501nobu
Moving public headers was 12-years ago, no depend files would expect ruby.h in the top source directory now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04introduce rb_nogvl C-API to mark ubf as async-signal-safenormal
zlib and bignum both contain unblocking functions which are async-signal-safe and do not require spawning additional threads. We can execute those functions directly in signal handlers without incurring overhead of extra threads, so provide C-API users the ability to deal with that. Other C-API users may have similar need. This flexible API can supercede existing uses of rb_thread_call_without_gvl and rb_thread_call_without_gvl2 by introducing a flags argument to control behavior. Note: this API is NOT finalized. It needs approval from other committers. I prefer shorter name than previous rb_thread_call_without_gvl* functions because my eyes requires big fonts. [Bug #15499] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-07zlib (gzfile_write_raw): do not resize string after .write callnormal
Apparently, a component of Rails implements a buffering .write method which keeps the String buffer around and makes it unsafe for us to clear it after calling .write. This caused Rack::Deflater to give empty results when enabled. Fortunately, per r61631 / a55abcc0ca6f628fc05304f81e5a044d65ab4a68, this misguided optimization was only worth a small (0.5MB) savings and we still benefit from the majority of the memory savings in that change. Thanks to zunda for the bug report. [ruby-core:90133] [Bug #15356] Fixes: r61631 (commit a55abcc0ca6f628fc05304f81e5a044d65ab4a68) ("zlib: reduce garbage on gzip writes (deflate)") git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-18zlib: fix Zlib::VERSIONnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-07Removed needless date attribute from gemspec of default gems.hsbt
They are assigned automatically when pushing gem file to rubygems.org. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-18zlib (rb_gzreader_getc): localize and return cbuf directlynormal
No point in having a long-lived cbuf in "struct gzfile" since GZFILE_CBUF_CAPA is smaller than RSTRING_EMBED_LEN_MAX (even on 32-bit). We can also have rb_econv_convert write directly to the return value instead of an intermediate buffer. This brings "struct gzfile" from 264 to 256 bytes on 64-bit systems to avoid taking an additional cache line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e