lq-text: erealloc

char * erealloc(Object, NewSize) char *Object; unsigned int NewSize;

Purpose

Changes the size of the given Object, either by extending the area of memory allocated to it or by allocating a new area, copying the data and freeing the original storage area.

If insufficient memory is available, a fatal (E_FATAL) error is produced, which includes the given What argument as a textual (human-readable) description of the object.

The system-supplied realloc function is used.

Returns

A pointer to the newly sized object; in most implementations this will almost always be a new copy of the object.

A future release of lq-text will have an improved memory allocation interface.

Errors

A fatal (E_FATAL | E_MEMORY) error is produced if memory is exhausted.

See Also: