PreviousNext

The client_memory Attribute

While marshalling parameters, the client stub uses built-in routines to manage memory. You can use the client_memory attribute to specify different memory allocation and free routines. The client_memory attribute has the following syntax in the ACF header:

[client_memory(malloc_routine, free_routine)] interface idl
_interface_name

The routines you specify must have the same respective procedure declarations as the system's malloc( ) and free( ) routines.

Applications need to manage memory consistently, so if your application needs to do other memory allocation, be sure to use the same routines you specified with the client_memory attribute.

You can use the client_memory attribute in conjunction with RPC stub support API routines, such as rpc_sm_set_client_alloc_free( ) and rpc_sm_swap_client_alloc_free( ).