Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

NAME

XtMalloc − allocate memory. 

SYNOPSIS

char ∗XtMalloc(size);
    Cardinalsize;

Inputs

sizeSpecifies the number of bytes of memory to allocate. 

Returns

A pointer to allocated memory. 

DESCRIPTION

XtMalloc() allocates and returns a block of size bytes of memory.  If there is insufficient memory to allocate the new block, XtMalloc() terminates by calling XtErrorMsg(). 

XtMalloc() makes no guarantee about the contents of the memory when it is allocated. 

USAGE

In most cases, you will have to cast the return value of XtMalloc() to an appropriate pointer type. 

XtNew() and XtNewString() provide slightly higher-level approaches to memory allocation. 

Memory allocated with XtMalloc() must be deallocated with XtFree().  The function XtMalloc() is implemented by the Toolkit independently of the particular environment, so programs ported to a system not supporting malloc will still work. 

SEE ALSO

XtCallocUNIX SYSTEM V/68, XtErrorMsgUNIX SYSTEM V/68, XtFreeUNIX SYSTEM V/68, XtNewUNIX SYSTEM V/68, XtNewStringUNIX SYSTEM V/68, XtReallocUNIX SYSTEM V/68. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026