[pooma-dev] Re: Ref counting
James Crotinger
jcrotinger at proximation.com
Fri Apr 12 22:35:55 UTC 2002
Something else is wrong. Array and Field are just wrappers around
ref-counted engines. Thus there should be no problem doing something like:
Array<1> foo()
{
Array<1> retval(10,10);
retval = 3;
return retval;
}
Memory could be getting stepped on, or he might be returning a reference
instead of a value.
Jim
>-----Original Message-----
>From: Mark Mitchell [mailto:mark at codesourcery.com]
>Sent: Friday, April 12, 2002 2:43 PM
>To: Nils H. Busch; pooma-dev at pooma.codesourcery.com
>Subject: [pooma-dev] Re: Ref counting
>
>> Is there a way to increase ref count of object to reference it outside
>> of function scope or am trying to do something deprecated ? Should I be
>> passing in a reference argument and initialize Array/Field in the
>> function ?
>
>I suggest allocating the new Array/Field with "new", rather than as a
>local variable, and then returning it the pointer.
>
>Jeffrey, do you have alternative ideas?
>
>--
>Mark Mitchell mark at codesourcery.com
>CodeSourcery, LLC http://www.codesourcery.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/pooma-dev/attachments/20020412/8f395a0e/attachment.html>
More information about the pooma-dev
mailing list