[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

[C ext 2 Ruby] questions about rb_iv_set/get

pere.noel

8/31/2006 9:38:00 PM


i do have some questions about rb_iv_set/get in order to know if i must
** OR NOT ** free mem allocation relevant to VALUEs passed to rb_iv_set
?

are only pointers stored ore copies of strings ?
--
une bévue
4 Answers

pat eyler

8/31/2006 9:52:00 PM

0

On 8/31/06, Une bévue <pere.noel@laponie.com.invalid> wrote:
>
> i do have some questions about rb_iv_set/get in order to know if i must
> ** OR NOT ** free mem allocation relevant to VALUEs passed to rb_iv_set
> ?
>
> are only pointers stored ore copies of strings ?

I'm afraid I can't help you with your question, but I can help you get
more answers. It's a simple thing, just don't post with the broken
[EXTRA TAGS THAT MAKE YOUR SUBJECT HARD TO READ] subject
line.


> --
> une bévue
>
>


--
thanks,
-pate
-------------------------
http://on-ruby.bl...

Tim Hunter

8/31/2006 9:56:00 PM

0

Une bévue wrote:
> i do have some questions about rb_iv_set/get in order to know if i must
> ** OR NOT ** free mem allocation relevant to VALUEs passed to rb_iv_set
> ?
>
> are only pointers stored ore copies of strings ?
>
Assuming you're using one of the rb_str_new family of functions to
create Ruby String objects from C strings, Ruby makes a copy of the C
string in Ruby-managed memory. In general Ruby objects are always in
Ruby-managed memory unless you're wrapping one of your own C structures
into a Ruby object with Data_Wrap_Struct.

pere.noel

9/1/2006 6:04:00 AM

0

pat eyler <pat.eyler@gmail.com> wrote:

> I can help you get
> more answers. It's a simple thing, just don't post with the broken
> [EXTRA TAGS THAT MAKE YOUR SUBJECT HARD TO READ] subject
> line.

what are those exactly ? the "[C ext 2 Ruby]" : for my point of view it
is to advert people this thread speaks about "C ext 2 Ruby", not all are
interested...

or, is it for the "/" of "rb_iv_set/get" ???
--
une bévue

pere.noel

9/1/2006 6:04:00 AM

0

Timothy Hunter <TimHunter@nc.rr.com> wrote:

> Assuming you're using one of the rb_str_new family of functions to
> create Ruby String objects from C strings, Ruby makes a copy of the C
> string in Ruby-managed memory. In general Ruby objects are always in
> Ruby-managed memory unless you're wrapping one of your own C structures
> into a Ruby object with Data_Wrap_Struct.

ok, fine, thanks, for this precise answer !
--
une bévue