Luo Yongheng
2008-04-05 21:54:36 UTC
Hi,
I did not find explanations on how to manage memory allocation/release with pointer types in C++ mapping specification.
If a servant function returns a pointer to a dynamically allocated memory, the servant generally allocates a heap memory block and assign it to the returned pointer. Then whose responsibility is it to release this heap memory block?
According to the case explanation on returning string type (very similiar to pointer type?) in mapping specification, it is the caller's responsibility to release the memory. From servant side, the caller is the ORB. So we can say it is the ORB's responsibility to release all memories allocated by servants? So what routines should I conform to when allocating memory in servants?
Thanks.
Thierry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080405/204f6a3e/attachment.htm
I did not find explanations on how to manage memory allocation/release with pointer types in C++ mapping specification.
If a servant function returns a pointer to a dynamically allocated memory, the servant generally allocates a heap memory block and assign it to the returned pointer. Then whose responsibility is it to release this heap memory block?
According to the case explanation on returning string type (very similiar to pointer type?) in mapping specification, it is the caller's responsibility to release the memory. From servant side, the caller is the ORB. So we can say it is the ORB's responsibility to release all memories allocated by servants? So what routines should I conform to when allocating memory in servants?
Thanks.
Thierry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080405/204f6a3e/attachment.htm