InitAtomTable

2.x

  BOOL InitAtomTable(cTableEntries)    
  int cTableEntries; /* size of atom table */

The InitAtomTable function initializes the local atom hash table and sets it to the specified size.

An application need not use this function to use a local atom table. The default size of the local and global atom hash tables is 37 table entries. If an application uses InitAtomTable, however, it should call the function before any other atom-management function.

Parameters

cTableEntries

Specifies the size, in table entries, of the atom hash table. This value should be a prime number.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero.

Comments

If an application uses a large number of local atoms, it can increase the size of the local atom table, reducing the time required to add an atom to the local atom table or to find an atom in the table. However, this increases the amount of memory required to maintain the table.

The size of the global atom table cannot be changed from its default size of 37 entries.

Example

The following example uses the InitAtomTable function to change the size of the local atom table to 73:

BOOL fSuccess;

fSuccess = InitAtomTable(73);

if (fSuccess)
    MessageBox(hwnd, "table initialization succeeded",
        "InitAtomTable", MB_OK);
else
    MessageBox(hwnd, "table initialization failed",
        "InitAtomTable", MB_ICONEXCLAMATION);