Skip to content

Commit

Permalink
fix: Fix native extension initialization
Browse files Browse the repository at this point in the history
Ruby will execute the initializing function named “Init_LIBRARY” in the library when requiring the extension:
https://docs.ruby-lang.org/en/3.0/doc/extension_rdoc.html
danielpclark/rutie#142
  • Loading branch information
baygeldin committed Mar 7, 2022
1 parent 53ef8e2 commit 78c7495
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/tantiny.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
require "tantiny/query"
require "tantiny/index"

require_relative "tantiny.so"

module Tantiny
Rutie.new(:tantiny).init "init_tantiny", __dir__
end
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mod query;
mod tokenizer;

#[no_mangle]
pub extern "C" fn init_tantiny() {
pub extern "C" fn Init_tantiny() {
index::init();
query::init();
tokenizer::init();
Expand Down

0 comments on commit 78c7495

Please sign in to comment.