BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo C Function Reference

rpc_sm_swap_client_alloc_free, rpc_ss_swap_client_alloc_free(3c)

Name

rpc_sm_swap_client_alloc_free(), rpc_ss_swap_client_alloc_free() - exchanges current memory allocation and freeing mechanism used by client stubs with one supplied by client

Synopsis

#include <rpc/rpc.h>
void rpc_sm_swap_client_alloc_free(
idl_void_p_t (*p_allocate)(unsigned long size),
void (*p_free) (idl_void_p_t ptr),
idl_void_p_t (**p_p_old_allocate)(unsigned long size),
void (**p_p_old_free)( idl_void_p_t ptr),
unsigned32 *status)

void rpc_ss_swap_client_alloc_free(
idl_void_p_t (*p_allocate)(unsigned long size),
void (*p_free) (idl_void_p_t ptr),
idl_void_p_t (**p_p_old_allocate)(unsigned long size),
void (**p_p_old_free)( idl_void_p_t ptr))

Description

The rpc_sm_swap_client_alloc_free() routine exchanges the current allocate and free mechanisms used by the client stubs for routines supplied by the caller. The input parameters, p_allocate and p_free, specify new memory allocation and free routines. The output parameters, p_p_old_allocate and p_p_old_free return the memory allocation and free routines in use before the call to this routine.

When a callable routine is an RPC client, it may need to ensure which allocate and free routines are used, despite the mechanism its caller had selected. This routine allows scoped replacement of the allocation/free mechanism to allow this.

The output parameter, status, returns the status code from this routine. This status code indicates whether the routine completed successfully or, if not, why not. Possible status codes and their meanings include:

rpc_s_ok

Success.

rpc_s_no_memory

Insufficient memory available to set up necessary data structures.

rpc_ss_swap_client_alloc_free is the exception-returning version of this function and has no status output parameter. The following exceptions are raised by this routine.

rpc_x_no_memory

Insufficient memory available to set up necessary data structures.

A thread in a multithreaded application may issue a call to rpc_sm_swap_client_alloc_free() or rpc_ss_swap_client_alloc_free() while running in any context state, including TPINVALIDCONTEXT.

Return Values

None.

See Also

rpc_sm_allocate, rpc_ss_allocate(3c), rpc_sm_free, rpc_ss_free(3c), rpc_sm_set_client_alloc_free, rpc_ss_set_client_alloc_free(3c)

Programming a BEA Tuxedo Application Using TxRPC