A method and apparatus for performing distributed object calls uses proxies
and memory allocation and deallocation. Specifically, an object reference
to an object is obtained. The object reference is used to create a proxy
handle data structure that will represent the object. The proxy handle is
passed to a client application stub function which calls the object. The
stub function is also passed input and output parameters along with
exception information. An object request broker finds an appropriate
implementation in a server application. The server application allocates
memory for implementing the call. The object is implemented and the memory
allocated by the server application is deallocated. The server application
responds to the client, whereupon the client makes another object call
using the same proxy handle or destroys the proxy handle. Multiple
initialization of object calls is avoided because the object call can be
initialized just once for a particular object. Moreover, resources are
preserved by minimizing wild pointers and memory leaks that can occur
during the calling and implementation of objects.