Sun StorageTek 5800 System Client API Reference Guide

Initializing a Global Session

The following function initializes a global session:

    hcerr_t hc_init(allocator_t, 

This function must be called once per process to initialize the memory functions used in the 5800 system C API. It also initializes global session properties.

A global session is initialized once per process, regardless of how many threads in that process are using the C API.

Note –

hc_init should be called once per process before any thread calls hc_session_create_ez. If hc_session_create_ez is called before hc_init, an implicit call is made to hc_init from that thread. But that call to hc_init is not interlocked with other threads, and it uses the C API shared library’s version of malloc and free, which might be different than the application’s version of malloc and free. It is strongly recommended that all applications call hc_init once per process with their own allocator and deallocator.

Note –

For more information on hc_session_create_ez , see hc_session_create_ez.