|
From: | James Crotinger |
Subject: | RE: [pooma-dev] Re: Ref counting |
Date: | Fri, 12 Apr 2002 16:35:55 -0600 |
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:address@hidden]
>Sent: Friday, April 12, 2002 2:43 PM
>To: Nils H. Busch; address@hidden
>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 address@hidden
>CodeSourcery, LLC http://www.codesourcery.com
[Prev in Thread] | Current Thread | [Next in Thread] |