StringPool 3I "15 August 1988" "InterViews" "InterViews Reference Manual"

Table of contents


NAME

StringPool - store strings in large chunks

SYNOPSIS

#include

DESCRIPTION

A string pool is an area for character storage. Because strings in a pool cannot be independently deallocated, it is generally faster to allocate them than to use new in C++ or malloc in C.

PUBLIC OPERATIONS

StringPool(int size = 800)
Construct a string pool. The size is used to allocate contiguous blocks of storage. When one block is consumed, another block is allocated from the operating system. The default block size will fit in a small page (1024-byte).
~StringPool()
Free the storage associated with the string pool.
char* Append(const char*, int)
Add a string of a given length to a pool. Append does not add a null to terminate strings in the pool; if desired, null-termination must be performed explicitly by the caller.

SEE ALSO

malloc(3)