Well, I do understand that I shouldn't pass the 2nd integer argument. But it's also not a good thing to crash the whole Ruby environment. In case, this is rails for example, and someone is doing that in byebug or something, it will crash whole server - and leaves a bad impression.
So if we don't accept integer, we can always check the type and raise rb_eArgError instead of crashing.
When I use this code:
It works reliably, and compresses very well.
But if I use this:
It core dumps. dump.txt
Well, I do understand that I shouldn't pass the 2nd integer argument. But it's also not a good thing to crash the whole Ruby environment. In case, this is rails for example, and someone is doing that in byebug or something, it will crash whole server - and leaves a bad impression.
So if we don't accept integer, we can always check the type and raise
rb_eArgError
instead of crashing.