---
name: "umad_alloc"
section: "3"
platform: "linux"
package: "rdma-core"
version: "65.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/umad_alloc"
---

# umad\_alloc(3)

allocate memory for umad buffers

## NAME

umad\_alloc - allocate memory for umad buffers

## SYNOPSIS

```
#include <infiniband/umad.h>

void * umad_alloc(int num, size_t size);
```

## DESCRIPTION

**umad\_alloc()** allocates memory for an array of *num* umad buffers of *size* bytes. Note that *size* should include the **umad\_size()** plus the length (MAD\_BLOCK\_SIZE for normal MADs or the length returned from **umad\_recv()** for RMPP MADs).

## RETURN VALUE

**umad\_alloc()** returns NULL if out of memory.

## SEE ALSO

[**umad\_free**(3)](/umad_free/3.md)

## AUTHOR

- Hal Rosenstock \<halr@voltaire.com\>
