ruby: fix "undefining the allocator of T_DATA" warnings
Ruby 3.2 introduced a warning when C-extensions use structs without
redefining the allocation default allocation routine meant for objects.
See https://bugs.ruby-lang.org/issues/18007 for details.
In the Ruby bindings this happens at `Data_Wrap_Notmuch_Object` call
sites, so the object types used there needed to update their allocation.
This ruby code (given a database at the hardcoded path with messages
matching `tag:tmp`) exercise all the ruby objects:
require 'notmuch'
Notmuch::Database.open File.expand_path("~/mail") do |db|
db.get_directory("/tmp")
db.query("tag:tmp").search_threads.each do |t|
t.messages.each do |m|
puts m.header("Subject")
end
end
end
Before these changes with ruby 3.2.5 and notmuch 0.38.3 it outputs:
notmuch.rb:5: warning: undefining the allocator of T_DATA class Notmuch::Query
notmuch.rb:5: warning: undefining the allocator of T_DATA class Notmuch::Threads
notmuch.rb:5: warning: undefining the allocator of T_DATA class Notmuch::Thread
notmuch.rb:6: warning: undefining the allocator of T_DATA class Notmuch::Messages
notmuch.rb:6: warning: undefining the allocator of T_DATA class Notmuch::Message
notmuch release 0.38.3 now available
(the last line is the message I tagged with tmp), and after the changes: