summaryrefslogtreecommitdiff
path: root/ext/zlib
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/zlib] [Bug #18358] Fix crash in zlib when in progressPeter Zhu2021-11-241-40/+77
| | | | | | | | When Zlib::Inflate#inflate or Zlib::Deflate#deflate is called recursively inside the block, a crash can occur because of an use-after-free bug. https://github.com/ruby/zlib/commit/50fb8a0338
* Update dependenciesNobuyoshi Nakada2021-11-211-1/+0
|
* [Feature #18290] Remove all usages of rb_gc_force_recyclePeter Zhu2021-11-081-4/+0
| | | | | This commit removes usages of rb_gc_force_recycle since it is a burden to maintain and makes changes to the GC difficult.
* [ruby/zlib] Bump up zlib version to 2.1.1Hiroshi SHIBATA2021-10-191-1/+1
| | | | https://github.com/ruby/zlib/commit/82e9a636a6
* [ruby/zlib] Fix a bug that GZipReader#gets may return incomplete lineSutou Kouhei2021-10-151-6/+6
| | | | | | | | | | | | | | | | | 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
* [ruby/zlib] Bump up zlib version to 2.1.0Hiroshi SHIBATA2021-10-141-1/+1
| | | | https://github.com/ruby/zlib/commit/dd593acaee
* [ruby/zlib] Bump version to v2.0.0Hiroshi SHIBATA2021-10-141-1/+1
| | | | https://github.com/ruby/zlib/commit/434eba55ae
* ruby tool/update-deps --fix卜部昌平2021-10-051-14/+23
|
* [ruby/zlib] Don't print out warnings when finalizingNobuyoshi Nakada2021-08-311-0/+2
| | | | https://github.com/ruby/zlib/commit/44a56d36e7
* [ruby/zlib] Revert "Don't print out warnings when freeing."Nobuyoshi Nakada2021-08-311-1/+12
| | | | https://github.com/ruby/zlib/commit/931aa7a272
* [ruby/zlib] Don't print out warnings when freeing.Samuel Williams2021-08-311-12/+1
| | | | https://github.com/ruby/zlib/commit/098c50255d
* [ruby/zlib] Synchronize access to zstream to prevent segfault in ↵Jeremy Evans2021-07-281-1/+32
| | | | | | | | | | | | | | | | | 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
* Found library is not usable if the header is not foundNobuyoshi Nakada2021-07-061-1/+2
|
* Fix linking bundled zlibNobuyoshi Nakada2021-07-031-2/+2
| | | | | | | * Prefix "./" to the import library name to expanded when static linking exts. * Copy zlib shared library to the top build directory.
* Fix -Wundef warnings for HAVE_RB_EXT_RACTOR_SAFEBenoit Daloze2021-05-041-1/+1
| | | | * See [Feature #17752]
* [ruby/zlib] gemspec: Remove unused filesOlle Jonsson2021-04-201-2/+2
| | | | | | Remove the list of executables. https://github.com/ruby/zlib/commit/6a70725b8e
* dependency updates卜部昌平2021-04-131-1/+0
|
* Adjusted indents [ci skip]Nobuyoshi Nakada2021-03-171-5/+5
|
* zlib: fix Gzip{Writer,Reader}.new fails with a O_TMPFILE fileSorah Fukumori2021-03-171-4/+14
|
* [ruby/zlib] Resume zstream if available [Bug #10961]wanabe2021-03-091-0/+6
|
* [ruby/zlib] Don't use gemspec for gem dependecyHiroshi SHIBATA2021-02-101-4/+0
| | | | https://github.com/ruby/zlib/commit/7d3d19710f
* zlib is ractor-safeKoichi Sasada2020-12-181-0/+4
|
* [ruby/zlib] Add Zlib::Inflate#inflate :buffer keyword argumentJeremy Evans2020-12-041-14/+69
| | | | | | | | | | 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
* [ruby/zlib] Allow Zlib.crc32 and .adler32 to accept IO instanceJeremy Evans2020-12-041-3/+16
| | | | | | | | | 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
* [ruby/zlib] Document that gets can return nil when eof? returns falseJeremy Evans2020-12-041-0/+2
| | | | | | | | This behavior differs from File#gets. Fixes [Bug #13904] https://github.com/ruby/zlib/commit/448e41efdd
* delete deprecated IO-like methods卜部昌平2020-12-031-30/+0
| | | | | | | | | 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.
* zlib: patches for mswin64Nobuyoshi Nakada2020-11-243-1/+101
| | | | | | | | * 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.
* zlib: extlibs to download zlib-1.2.11Nobuyoshi Nakada2020-11-241-0/+7
|
* [ruby/zlib] Add Zlib::GzipReader.zcat for handling multiple gzip streams in ↵Jeremy Evans2020-09-141-0/+55
| | | | | | | | | | | | | 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
* sed -i '/rmodule.h/d'卜部昌平2020-08-271-1/+0
|
* sed -i '/r_cast.h/d'卜部昌平2020-08-271-1/+0
|
* sed -i '\,2/extern.h,d'卜部昌平2020-08-271-1/+0
|
* Update the license for the default gems to dual licensesHiroshi SHIBATA2020-08-181-1/+1
|
* sed -i 's|ruby/impl|ruby/internal|'卜部昌平2020-05-111-140/+140
| | | | To fix build failures.
* sed -i s|ruby/3|ruby/impl|g卜部昌平2020-05-111-140/+140
| | | | This shall fix compile errors.
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-081-0/+152
| | | Split ruby.h
* [ruby/zlib] Bump version to 1.1.0Hiroshi SHIBATA2019-11-301-1/+1
| | | | https://github.com/ruby/zlib/commit/5af77c1ee8
* Adjust a fucntion signatureNobuyoshi Nakada2019-11-051-2/+8
|
* [ruby/zlib] Removed no longer used variablesNobuyoshi Nakada2019-10-311-2/+1
| | | | https://github.com/ruby/zlib/commit/3e98e4cac3
* [ruby/zlib] Fix setting mtime to zero in GzipWriterAlan Wu2019-10-311-1/+3
| | | | | | | | | | | 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
* [ruby/zlib] Remove taint supportJeremy Evans2019-10-311-35/+1
| | | | | | | | 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
* [ruby/zlib] Fix for older ruby 2.6 or earlierNobuyoshi Nakada2019-09-291-0/+9
| | | | https://github.com/ruby/zlib/commit/00ead8cb2c
* [ruby/zlib] Search zlib.c as a gemNobuyoshi Nakada2019-09-291-4/+11
| | | | https://github.com/ruby/zlib/commit/8f43b264cd
* Make rb_scan_args handle keywords more similar to Ruby methods (#2460)Jeremy Evans2019-09-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* rb_ensure now free from ANYARGS卜部昌平2019-08-271-4/+11
| | | | | | 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.
* rb_rescue / rb_rescue2 now free from ANYARGS卜部昌平2019-08-271-4/+2
| | | | | | 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.
* Include ruby/assert.h in ruby/ruby.h so that assertions can be thereNobuyoshi Nakada2019-07-141-0/+1
|
* Removed moving toplevel header since r12501nobu2019-02-081-1/+1
| | | | | | | 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
* introduce rb_nogvl C-API to mark ubf as async-signal-safenormal2019-01-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* zlib (gzfile_write_raw): do not resize string after .write callnormal2018-12-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | 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