[FriBidi] fribidi 0.10.9 is now available

Till Vollmer tvollmer at codemart.de
Sun Aug 12 02:28:13 PDT 2007


Hi,

The tests are working now. But I have a different problem:

I am working on a Ruby wrapper and it works fine functionally but  
whenever the Ruby garbage collector kicks in I got an BUS error. I  
had my wrapper code checked by someone who does that very ofter and  
he says it's ok, so the problem must be either in the way I call  
fribidi stuff or in fribidi. Attached the code. Maybe someone can  
check if I do it ok.
Any help would be very appreciated.

-------------
#include "ruby.h"
#include "fribidi/fribidi.h"
#include "fribidi/fribidi_types.h"

static VALUE t_convert(VALUE klass, VALUE obj)
{
     VALUE ret;
     FriBidiChar *visual_str;
     FriBidiChar *us;
     int len_unicode;
     int  len_utf8;
     char* result;
     FriBidiCharType base=FRIBIDI_TYPE_L;
     us= (FriBidiChar*) malloc( RSTRING(obj)->len*4+1);   /*hack we  
dont know how long the unicode piece will be*/
     rb_eval_string("puts 'Enter 1'");

     len_unicode=fribidi_utf8_to_unicode (RSTRING(obj)->ptr, RSTRING 
(obj)->len,
                    us);

     visual_str= (FriBidiChar*) malloc(len_unicode +1);

     rb_eval_string("puts 'Enter 2'");

     fribidi_log2vis(
              us,
              len_unicode,
              &base,

              visual_str,
              NULL,
              NULL,
              NULL);

         result=(char*) malloc(RSTRING(obj)->len+1);

         rb_eval_string("puts 'Enter 3'");

         len_utf8=fribidi_unicode_to_utf8(visual_str,  
len_unicode,result);
         rb_eval_string("puts 'Enter 4'");

    ret =  rb_str_new2(result);
    rb_eval_string("GC.start");   /* this sometimes causes the BUS  
error  also happens when GC is called from the system*/
     rb_eval_string("puts 'Enter 5'");

    free(result);
    free(visual_str);
    free(us);
    return ret;
}


VALUE cTest;

void Init_rbidi() {
   cTest = rb_define_class("RBidi", rb_cObject);
   rb_define_singleton_method(cTest, "convert", t_convert, 1);
}

--------------------





















Am 10.08.2007 um 01:47 schrieb Behdad Esfahbod:

> This should fix the bug that was recently raised on the list.
> Instructions available at: http://fribidi.org/
>
> Regards,
> -- 
> behdad
> http://behdad.org/
>
> "Those who would give up Essential Liberty to purchase a little
>  Temporary Safety, deserve neither Liberty nor Safety."
>         -- Benjamin Franklin, 1759
>
>
>
> _______________________________________________
> fribidi mailing list
> fribidi at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/fribidi

Codemart GmbH
Till Vollmer
Managing Director
Tel: +49 (0)89 1213 5359
Mob: + 49 (0)160 718 7403
Fax: +49 (0)89 1892 1347
Yahoo ID: till_vollmer
Skype: till_vollmer
www.codemart.de
till.vollmer at codemart.de





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/fribidi/attachments/20070812/1b44d5b3/attachment.html 


More information about the fribidi mailing list