[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[n00b] Garbage collection, Ruby C++ and SWIG

Asbjørn Reglund Thorsen

1/15/2005 12:10:00 PM

4 Answers

ts

1/15/2005 2:27:00 PM

0

>>>>> "A" == =?ISO-8859-1?Q?Asbj=F8rn Reglund Thorsen?= <ISO-8859-1> writes:

A> I`m having trouble with an interface to a c++ library. It seems like
A> Ruby`s GC is collecting objects that it shouldn`t. I have read the
A> SWIG-Ruby documentation on the matter, but I am unsure of where to put the
A> markfunc , and how to get it to interact with my program.

A> My interface file : mHeat1.i

Well, difficult to say without seeing the source but probably the problem
has nothing to do with the mark function.

A> #0 0x00000089 in ?? ()
A> #1 0x40388c19 in free_MenuSystem () from ./mHeat1.so
A> #2 0x0806f636 in rb_gc_call_finalizer_at_exit () at gc.c:1858
A> #3 0x08053e34 in ruby_finalize_1 () at eval.c:1418
A> #4 0x08053f43 in ruby_cleanup (ex=0) at eval.c:1453
A> #5 0x08054081 in ruby_stop (ex=135573240) at eval.c:1484

ruby is at the end (it will exist) and it call the finalizers : this is the
normal operation.

There are many reasons for such a crash :
* free_MenuSystem() is called twice
* the free function must be called in a predefined order
* ...

Difficult to say more without the source.

Guy Decoux


Asbjørn Reglund Thorsen

1/17/2005 11:06:00 AM

0

ts

1/17/2005 11:49:00 AM

0

>>>>> "A" == =?ISO-8859-1?Q?Asbj=F8rn Reglund Thorsen?= <ISO-8859-1> writes:

A> The header file is located at http://folk.uio.no/asbjoert/Me...

Do diffpack (it's diffpack no ?), or one of the libraries (tk, mesa, ...)
is compiled with pthread support ?



Guy Decoux



Asbjørn Reglund Thorsen

1/17/2005 1:38:00 PM

0