Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rpc_ss_swap_client_alloc_free(3) — OSF1 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rpc_ss_allocate(3)

rpc_ss_free(3)

rpc_ss_set_client_alloc_free(3)

rpc_ss_swap_client_alloc_free(3)  —  Subroutines

NAME

rpc_ss_swap_client_alloc_free - Exchanges the current memory allocation and freeing mechanism used by the client stubs with one supplied by the client

Used by client applications. 

SYNOPSIS

#include <dce/rpc.h>
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)
      );

PARAMETERS

Input

p_allocateSpecifies a pointer to a routine that has the same procedure declaration as the malloc routine and that is used for allocating client stub memory. 

p_freeSpecifies a pointer to a routine that has the same procedure declaration as the free routine and that is used for freeing client stub memory. 

Output

p_p_old_allocateSpecifies a pointer to a pointer to a routine that has the same procedure declaration as the malloc routine. A pointer to the routine that was previously used to allocate memory is returned in this parameter. 

p_p_old_freeSpecifies a pointer to a pointer to a routine that has the same procedure declaration as the free routine. A pointer to the routine that was previously used to free memory is returned in this parameter. 

(Note: In ANSI standard C environments, idl_void_p_t is defined as void ∗ and in other environments is defined as char ∗.) 

DESCRIPTION

The rpc_ss_swap_client_alloc_free routine exchanges the current client allocate and free mechanism used by the client stubs for one supplied by the caller. If it is appropriate for the client code called by an application to use a certain memory allocation and freeing mechanism, regardless of its caller’s state, the client code can swap its own mechanism into place on entry, replacing its caller’s mechanism. It can then swap the caller’s mechanism back into place prior to returning. 

See the Rules for Using Memory Management Routines in the Pointers section of the Interface Definition Language chapter in the NCS 2.0 Programmer’s Guide. 

RETURN VALUES

An exception, rpc_x_no_memory, when there is insufficient memory available to set up necessary data structures. 

EXAMPLES

None. 

RELATED INFORMATION

Functions: rpc_ss_allocate(3), rpc_ss_free(3), rpc_ss_set_client_alloc_free(3)
 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026