rails-sqlserver / tiny_tds

TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library.
Other
605 stars 191 forks source link

Ruby 3.2 warning: undefining the allocator of T_DATA class TinyTds::Result #515

Closed jeremyevans closed 9 months ago

jeremyevans commented 2 years ago

When running tiny_tds on Ruby 3.2.0-preview 1, you get a warning when first accessing the TinyTds::Result class:

warning: undefining the allocator of T_DATA class TinyTds::Result

You can probably avoid this by adding rb_undef_alloc_func(cTinyTdsResult); after https://github.com/rails-sqlserver/tiny_tds/blob/e3e79a030271891b11b6e7676382fe31f389b099/ext/tiny_tds/result.c#L586

For details, see https://bugs.ruby-lang.org/issues/18007 and https://ruby-doc.org/core-3.1.1/doc/extension_rdoc.html#label-C+struct+to+Ruby+object

stillhart commented 1 year ago

Wow, @jeremyevans, you were early :-). I get this warning now with the official release of Ruby 3.2.0, so it's still relevant.