Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtAlloc(1)

XtErrorMsg(1)

XtFree(1)

XtMalloc(1)

XtNew(1)

XtNewString(1)

Name

XtRealloc — change the size of an allocated block of storage. 

Synopsis

char ∗XtRealloc(ptr, num);

    char ∗ptr;
    unsigned int num;

Arguments

ptrSpecifies a pointer to the old storage. 

numSpecifies the number of bytes desired in total storage. 

Description

XtRealloc changes the size of a block of storage, possibly moving it.  Then, it copies the old contents (or as much as will fit) into the new block and frees the old block.  If there is insufficient memory to allocate the new block, XtRealloc terminates by calling XtErrorMsg. 

If ptr is NULL, XtRealloc allocates the new storage without copying the old contents.  That is, it simply calls XtMalloc. 

The function XtRealloc is implemented by the Toolkit independently of the particular environment, so programs ported to a system not supporting realloc will still work. 

See Also

XtAlloc(1), XtErrorMsg(1), XtFree(1), XtMalloc(1), XtNew(1), XtNewString(1). 

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