|
|
Free the memory allocated to the CORBA sequence
I have a basic CORBA question.
On my CORBA server I have allocated memory for an out parameter of
type CORBA sequence. I have used c++ "new" to allocate the memory. Now
I want to make sure that the memory gets freed so how should I go
about that ?
- Should the client notify the server that it has received the value
of the out parameter and now the server can free the memory.
or
- CORBA will free the memory allocated to the sequence automatically
and I don't need to worry about freeing the memory.
Thanks in advance.
Ganesh
|
|
0
|
|
|
|
Reply
|
ganesh.tambat (31)
|
4/21/2009 2:13:57 PM |
|
Kasparov wrote:
> I have a basic CORBA question.
>
> On my CORBA server I have allocated memory for an out parameter of
> type CORBA sequence. I have used c++ "new" to allocate the memory. Now
> I want to make sure that the memory gets freed so how should I go
> about that ?
>
> - Should the client notify the server that it has received the value
> of the out parameter and now the server can free the memory.
>
> or
>
> - CORBA will free the memory allocated to the sequence automatically
> and I don't need to worry about freeing the memory.
>
> Thanks in advance.
> Ganesh
>
In CORBA all parameters are owned by the calling code. Your code on
server side is called by the ORB runtime, which will free the space
allocated by your implementation. When you are done using the sequence
on the client side, simply release it. You do not need to worry about
releasing the memory on the server side. However, to ensure that your
code works correctly, use the allocbuff method in the sequence class.
Raghu
|
|
0
|
|
|
|
Reply
|
Raghu
|
4/21/2009 3:03:02 PM
|
|
Raghu V. Hudli wrote:
> In CORBA all parameters are owned by the calling code. Your code on
> server side is called by the ORB runtime, which will free the space
> allocated by your implementation. When you are done using the sequence
> on the client side, simply release it. You do not need to worry about
> releasing the memory on the server side. However, to ensure that your
> code works correctly, use the allocbuff method in the sequence class.
Using "new" is correct for the sequence object itself. "allocbuf" is
used to allocate a buffer for the sequence object to use as storage, and
is often unnecessary.
--
Jon Biggar
jon@floorboard.com
jon@biggar.org
jonbiggar@gmail.com
|
|
0
|
|
|
|
Reply
|
Jon
|
4/24/2009 4:29:21 AM
|
|
|
2 Replies
259 Views
(page loaded in 0.182 seconds)
Similiar Articles: Memory Reallocation broken in R2008b and higher - comp.soft-sys ...Maybe a bug report to TMW is in order. Tested ... and-grow cycle, then if you shrink the memory allocation ... 32 bit Vista and the mxRealloc() doesn't free the memory. How to check whether malloc has allocated memory properly in case ...How to check whether malloc has allocated memory properly in ... to the same, simple block of reserved memory? Then free() can ... adequate if the sums were accumulated in order ... Overloading operators new and delete - comp.lang.c++.moderated ...Is the memory suppose to be free after delete, even ... this code is to reuse the memory allocated ... all of the bytes in the memory to 0xAD. Memset only uses the low order ... How to return a 2D double array in Mex - comp.soft-sys.matlab ...2) MATLAB stores 2D matrices in column order, whereas in your C++ ... mxSetPr(plhs[0], candi); The mxSetPr function does *not* free any existing allocated memory ... segmentation fault when shared object using STL is statically ...Memory allocated by one can not be freed by another. ... calloc(), realloc(), etc.) by one DSO can be free()d ... Cheers, -- In order to understand recursion you must ... Modifying MEX arguments in place? - comp.soft-sys.matlab ...It has to grab the data memory as one contiguous chunk in order for all of the other things ... memory? i.e., if it fails in a mex routine does it free all memory allocated ... 42S manual and self test - comp.sys.hp48I will not order the HP Museum CD. > I just need this ... A free GUI application of Self-Organizing Map: An ... of HP Calculators Manual register / program memory allocation ... Why programs can't be assembled like Legos - comp.programming ...We could build everything out of NANDs or sequences, decisions ... How to check whether malloc has allocated memory properly in case ..... empty) free(p);} You can do this ... gzip-compressing an in-memory string using zlib 1.2.3 - comp.unix ...... fprintf(stderr, "deflateEnd() = Z_OK\n"); free(dst ... Usage Example - The gzip home page So please read ... with ... order of allocation to help memory ... getaddrinfo() bug ? - comp.unix.solarisIn order to continue, use: ::cont SIGILL and ... buftag_t; The redzone is only verified on free ... malloc() points to an issue in the use of the allocated memory ... IDL to C++ Language Mapping - Instituto de Matemática e ...CORBA::string_free. Releases the memory associated with a string that was allocated with CORBA::string_alloc. ... methods to allocate or free any memory used by a sequence. ... Using Opaque Types in IDLCORBA::Request& operator<<( ... should free the memory allocated to the opaque object (allocated in operator>>()) in order to avoid a memory leak for inout and out ... 7/25/2012 5:30:22 AM
|
|
|
|
|
|
|
|
|