Discussion:
[omniORB] Nil Object References memory?
Martin Trappel
2008-07-14 12:00:17 UTC
Permalink
Hi!

In omniORB docs chapter 12.1 (dynamic loading and unloading): "... which
is that normally nil object references are heap allocated, and only
deallocated when the ORB is destroyed. ..."

Does that mean that a long running program that never shuts down the orb
will 'leak' memory? Or is there just one nil object for each interface
or something alike?

cheers,
Martin
Martin Trappel
2008-07-14 12:10:58 UTC
Permalink
Post by Martin Trappel
Hi!
In omniORB docs chapter 12.1 (dynamic loading and unloading): "... which
is that normally nil object references are heap allocated, and only
deallocated when the ORB is destroyed. ..."
Does that mean that a long running program that never shuts down the orb
will 'leak' memory? Or is there just one nil object for each interface
or something alike?
OK. I should have checked the sources beforehand. One nil object
reference per interface:
-----------------------
Echo_ptr
Echo::_nil()
{
#ifdef OMNI_UNLOADABLE_STUBS
static _objref_Echo _the_nil_obj;
return &_the_nil_obj;
#else
static _objref_Echo* _the_nil_ptr = 0;
if( !_the_nil_ptr ) {
omni::nilRefLock().lock();
if( !_the_nil_ptr ) {
_the_nil_ptr = new _objref_Echo;
registerNilCorbaObject(_the_nil_ptr);
}
omni::nilRefLock().unlock();
}
return _the_nil_ptr;
#endif
}
------------------------

Sorry for the noise :-)

cheer,
Martin

Loading...