From: nobu.nokada@... Date: 2003-08-02T09:38:40+09:00 Subject: Re: rb_raise with dynamic strings and GC Hi, At Sat, 2 Aug 2003 09:12:44 +0900, Dan Janowski wrote: > What will happen with errstr after the function returns since I did not > really use it as part of an object? > Will errstr be found by the GC and cleaned up? Yes, it is expected so. > I could just use message with rb_raise, but I would rather not have a > malloc being done far away and the free responsibility to be after use > in the rb_raise. Is this a bad idea? Should I just use > rb_exc_raise(errstr)? Not bad. Or, errobj = rb_exc_new2(eMyError, message); free(message); rb_exc_raise(errobj); # I guess you know that rb_exc_raise() expects an Exception # instance, and it was just a typo. -- Nobu Nakada