| Top |
| #define | CORBA_sequence_set_release() |
| #define | CORBA_sequence_get_release() |
| void | CORBA_free () |
| gpointer | ORBit_alloc_tcval () |
| gpointer | ORBit_realloc_tcval () |
#define CORBA_sequence_set_release(s,r) (s)->_release = r
CORBA_sequence_set_release() can be used to set the state of the
release flag. If the flag is set to TRUE, the sequence effectively
"owns" the storage pointed to by _buffer; if
FALSE, the programmer is responsible for the storage. If, for
example, a sequence is returned from an operation with its release
flag set to FALSE, calling CORBA_free() on the returned sequence
pointer will not deallocate the memory pointed to by
_buffer.
Also, passing a null pointer or a pointer to something other than
a sequence type to either CORBA_sequence_set_release() or
CORBA_sequence_get_release() produces undefined behavior.
CORBA_sequence_set_release() should only be used by the creator of a
sequence. If it is not called for a given sequence instance, then
the default value of the release flag for that instance is FALSE.
#define CORBA_sequence_get_release(s) (s)->_release
Before calling CORBA_free() on the
_buffer member of a sequence directly,
the programmer should check the release flag using
CORBA_sequence_get_release(). If it returns FALSE, the programmer
should not invoke CORBA_free() on the
_buffer member; doing so produces
undefined behavior.
void
CORBA_free (gpointer mem);
This function should be used to free memory that has been previously allocated with any CORBA memory allocation function. It does deep/recursive/intelligent deallocation of memory, including deallocation of values of CORBA_any types, sequence buffers and elements, etc.
gpointer ORBit_alloc_tcval (CORBA_TypeCode tc,guint nelements);
Allocates a memory buffer that can hold nelemems elements of type tc.
gpointer ORBit_realloc_tcval (gpointer old,CORBA_TypeCode tc,guint old_num_elements,guint num_elements);
Changes the size of a CORBA memory buffer.
old |
old memory segment, possibly allocated by |
|
tc |
typecode of the elements of the array |
|
old_num_elements |
current number of elements of the array |
|
num_elements |
new desired size of the array |