ToolTalk User's Guide

Allocating and Freeing Storage Space

The tt_malloc() and tt_free() functions are a general mechanism to help you easily manage allotted storage allocation.

Allocating Storage Space

tt_malloc() reserves a specified amount of storage in the allocation stack for your use. For example, you can use tt_malloc() to create a storage location and copy the sessid of the default session into that location.

Freeing Allocated Storage Space

To free storage of individual objects that the ToolTalk service provides you pointers to, use tt_free(). For example, you can free up the space in the API allocation stack that stores the sessid after you have examined the sessid. tt_free() takes an address in the allocation stack (a char * pointer or an address returned from tt_malloc()) as an argument.