axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksander Slominski <as...@cs.indiana.edu>
Subject memory management and AXIS_DEFINED_ARRAY
Date Fri, 28 May 2004 16:27:54 GMT
hi,

how is it supposed to be used - if i return new allocated 
AXIS_DEFINED_ARRAY will it be automatically deallocated?!

for example is this valid way to do echo? i have seen it in 
InteropTestPortType.cpp so that should be fine though in this case i do 
not understand who is de-allocating memory as xsd__int_Array is passed 
as input and returned as output? shouldnt service clone the array or 
auto pointer be used?

xsd__int_Array Benchmark1PortType::echoInts(xsd__int_Array Value0)
{
    return Value0;
}

and what about returning new value?

xsd__int_Array Benchmark1PortType::sendInts(int length)
{
    xsd__int_Array arr;
    arr.m_Size = length;
    arr.m_Array = (int *) malloc(length * sizeof(int));
    // fill in array with values
    return arr;
}

will it be de-allocated? do i miss something (documentation, examples)?

thanks,

alek

-- 
The best way to predict the future is to invent it - Alan Kay


Mime
View raw message