---
name: "VistaIOMalloc"
section: "3"
platform: "linux"
package: "libvistaio-dev"
version: "1.2.19-3+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/VistaIOMalloc"
---

# VistaIOMalloc(3)

memory allocation functions

## NAME

VistaIOMalloc, VistaIOCalloc, VistaIORealloc, VistaIOFree - memory allocation functions

## SYNOPSIS

```
VistaIOPointer VistaIOMalloc (size_t size);
```

**VistaIOPointer VistaIOCalloc (size\_t** *num***, size\_t** *elsize***);**

**VistaIOPointer VistaIORealloc (VistaIOPointer** *ptr***, size\_t** *size***);**

**void VistaIOFree (VistaIOPointer** *ptr***);**

## ARGUMENTS

- *size*

  **Specifies the number of bytes desired.**

- *num*

  **Specifies the number of array elements desired.**

- *elsize*

  **Specifies the size of an array element, in bytes.**

- *ptr*

  **Specifies a pointer to the old storage or to the block of storage that is**  **to be freed.**

## DESCRIPTION

**The VistaIOMalloc function returns a pointer to a block of storage of at least**  *size* **bytes. It returns**  **NULL** **, however, if** *size* **is zero.**

**The VistaIOCalloc function allocates space for** *num* **array elements of** **the size** *elsize***, initializing the space to zero bits. Like** **VistaIOMalloc, it returns** **NULL** **if asked to allocate zero space.**

**The VistaIORealloc function changes a block of storage, pointed to by**  *ptr***, to be of size** *size* **(possibly moving it). If necessary, it**  **allocates a new block at a different location, copies the old contents (or**  **as much as will fit) into the new block, and then frees the old block. If**  *ptr* **is**  **NULL** **, VistaIORealloc allocates the new storage without copying the old contents;** **that is, it simply calls VistaIOMalloc. If** *size* **is zero, it frees** **storage pointed to by** *ptr* **and returns** **NULL.**

**The VistaIOFree function frees storage, allowing it to be reused. If** *ptr* **is**  **NULL** **, VistaIOFree has no effect.**

## RETURN VALUES

**VistaIOMalloc, VistaIOCalloc, and VistaIORealloc each return a pointer to**  **the allocated storage.**

**VistaIOFree does not return a value.**

## SEE ALSO

[**malloc**(3)](/malloc/3.md), [**VistaIONew**(3)](/VistaIONew/3.md), [**VistaIONewString**(3)](/VistaIONewString/3.md), [**VistaIOError**(3)](/VistaIOError/3.md),

## DIAGNOSTICS

**If there is insufficient memory to allocate a requested block,** **VistaIOMalloc, VistaIOCalloc, or VistaIORealloc will terminate by calling** **[VistaIOError(3)](/VistaIOError/3.md) with the message \`\`Memory allocation failure''.**

## AUTHOR

**Art Pope \<pope@cs.ubc.ca\>**

**Adaption to vistaio: Gert Wollny \<gw.fossdev@gmail.com\>**

## ACKNOWLEDGMENT

**These functions and this manual page are based on similar ones** **included in the X Toolkit Intrinsics, which is**  **Copyright 1985, 1986, 1987, 1988** **Massachusetts Institute of Technology, Cambridge, Massachusetts,** **and Digital Equipment Corporation, Maynard, Massachusetts.**
