Ask a Question related to Ruby, Design and Development.
-
Mauricio Fernández #1
Re: I'm stuck
On Fri, Oct 10, 2003 at 01:15:26AM +0900, Friedrich Dominicus wrote:
void do_stuff()> Ok I understand that now, what do I have to do that it does not> > F> what you you mean which this step ?> > >> /* At this step you are playing a dangerous game with the GC */
> > F> ruby_init? How should I know what else to set up or use?
> >
> > Here a stupid example :
> >
> > int main(void)
> > {
> > char i;
> > VALUE obj;
> > VALUE klass;
> >
> > ruby_init();
> > obj = rb_str_new2("a string");
> >
> > /* call some ruby functions which call the GC */
> >
> > i = RSTRING(obj)->ptr[0];
> >
> > /* there are many chances than the String referenced by obj
> > was removed by the GC, and you have a segfault when you try
> > to access RSTRING(obj)->ptr[0] */
> happen?
>
> What's the simplest but too safe way to solve my simple problem. I
> just want the C side access the Ruby side as partly pointed out here.
{
char i;
VALUE obj;
VALUE klass;
obj = rb_str_new2("a string");
/* call some ruby functions which call the GC */
i = RSTRING(obj)->ptr[0];
...
}
int main(void)
{
ruby_init();
do_stuff();
}
--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
We apologize for the inconvenience, but we'd still like yout to test out
this kernel.
-- Linus Torvalds, announcing another kernel patch
Mauricio Fernández Guest
-
CFC Query - stuck, stuck, stuck
I am once again trying to use Dreamweaver. Here I want to create my first CFC. I'm following the online tutorial Building Your First Database... -
Stuck again
Ok i'm stuck on another one. I have four related tables retailers, products, price and category I need to have a form to add any new retailers.... -
[PHP] Fw: Am stuck
On Thu, 25 Sep 2003 15:17:26 +0200 "Chris Grigor" <aphrodit@iafrica.com> wrote: Look up str_pad(). ____ Regards, Andu Novac -
stuck with SQL
If you need to use subqueries, you need to upgrage to MySQL 4.1.x. In 4.0.14 you can restructure your query using a LEFT JOIN on the tables. ... -
php.. Am I stuck??
I purchased a program ( So I thought) that turned out to be just a bunch of php scripts put together. I am getting terrible support from the author... -
Mauricio Fernández #2
Re: I'm stuck
On Fri, Oct 10, 2003 at 01:22:21AM +0900, Friedrich Dominicus wrote:
rb_gc_register_address> I have another question related to this, aren't there any functions
> provided to inform the GC that a particular object should not be
> collected at the moment? As shown I do not know the ins/outs from
> Ruby, but I have learned about dealing with a copying GC in Eiffel an
> there some features are provided to exclude a particular object from
> beein moved. There this function have names with freeze or frozen in
> it. Is OBJ_FREEZE supposed to do something simular?
or simply keep a reference in the stack
--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
Less is more or less more
-- Y_Plentyn on #LinuxGER
Mauricio Fernández Guest



Reply With Quote

