I have a function which compares 2 strings char by char. I needed it to run much faster than it is in Ruby so I used RubyInline to rewrite the function in C. It did increase the speed about 100 fold. The function looks like this:
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 instead. I cannot figure out from a scanty documentation to RubyInline how to pass the ruby arrays into the function and how to convert them into C arrays. Any help is appreciated!