more embedding fun 
Author Message
 more embedding fun

(sorry if this is a repost, I don't think it is though)

I'm still playing with embedding ruby and I've run into a problem.  I
have ruby variables I've created that I need to keep in exsistance,
even though they don't have any names associated with them in ruby.
Is there any way to tell the garbage collector to keep something
resident, and then tell it later that it's okay to get rid of? I'd
like to keep the garbage collector around.  It's very useful.
However, I need to tell it to explicitly ignore certain objects until
it's told to get rid of them.

btw, this is actually causing problems because one of the classes has
a pointer to it's c object equivelent in it.  The garbage collector
reads that as damaged, and exits on a bug (which causes a bad
shutdown).



Sun, 31 Oct 2004 11:31:57 GMT  
 more embedding fun
If I'm not mistaken you can just call

rb_gc_register_address

To register a pointer to the object handle.

When your done

rb_gc_unregister_address

Ralph

Quote:
----- Original Message -----

Newsgroups: comp.lang.ruby

Sent: Wednesday, May 15, 2002 3:44 PM
Subject: more embedding fun

> (sorry if this is a repost, I don't think it is though)

> I'm still playing with embedding ruby and I've run into a problem.  I
> have ruby variables I've created that I need to keep in exsistance,
> even though they don't have any names associated with them in ruby.
> Is there any way to tell the garbage collector to keep something
> resident, and then tell it later that it's okay to get rid of? I'd
> like to keep the garbage collector around.  It's very useful.
> However, I need to tell it to explicitly ignore certain objects until
> it's told to get rid of them.

> btw, this is actually causing problems because one of the classes has
> a pointer to it's c object equivelent in it.  The garbage collector
> reads that as damaged, and exits on a bug (which causes a bad
> shutdown).



Sun, 31 Oct 2004 16:16:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. More embedding fun!

2. count bits, fun fun fun.

3. Lot of embed point: Where to embed?

4. Embeds in Embeds

5. ABC-embed for legacy embed: Validate Record: Filter Checking

6. 30 new pages of embedded products + UK Embedded Show

7. Debuggin embedded python: building device drivers for an embedded python virtual machine

8. Embedding Tcl Interpreter in an embedded system

9. Fun with Clients

10. Fun APL/J Programming Problem

11. roman and arabic - some fun(ctions)

12. Fun trivia question. :-)

 

 
Powered by phpBB® Forum Software