spec icon indicating copy to clipboard operation
spec copied to clipboard

Add specs for all of IO::Buffer constructors

Open trinistr opened this issue 2 months ago • 2 comments

Continuing from #1297


More weird stuff:

  • .map:
    • Specifying non-0 offset guarantees that everything breaks: size is computed incorrectly, crashing VM on reading the whole buffer, on macOS even a bounded read crashes VM, on Windows valid sizes are ???
      • https://bugs.ruby-lang.org/issues/21700
      • https://github.com/ruby/ruby/pull/15264
  • .new:
    • Passing LOCKED flag is intended? There is a test for that. But this seems like a bad idea to me, as it's not freeable (GC can still free it, though, I think).

trinistr avatar Nov 20 '25 15:11 trinistr

@ioquatix Could you review this maybe?

eregon avatar Nov 20 '25 20:11 eregon

@ioquatix Could you review this maybe?

This is still a very early draft, but that offset parameter made me create an issue and a PR to ruby directly, so, yeah :face_holding_back_tears: Reviewing the PR with fixes for the method is probably more useful currently.

trinistr avatar Nov 20 '25 21:11 trinistr

LGTM in general

eregon avatar Jan 04 '26 12:01 eregon