I have a function that compares 2 char strings to char. I need it to work much faster than in Ruby, so I used RubyInline to rewrite the function in C. This increased the speed by about 100 times. The function is as follows:
require 'inline'
inline do |builder|
builder.c "
static int distance(char *s, char *t){
...
}"
end
however I need to compare unicode strings. So I decided to use unpack ("U *") and compare arrays of integers. I canβt understand from the meager RubyInline documentation how to pass ruby ββarrays to a function and how to convert them to C. arrays Any help is appreciated!
dimus source
share