---
name: "read_allocate"
section: "3"
platform: "linux"
package: "libstaden-read-dev"
version: "1.15.0-1.1+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/read_allocate"
---

# read\_allocate(3)

Allocate and deallocate the Read structure.

## NAME

**read\_allocate**, **read\_deallocate** - Allocate and deallocate the **Read** structure.

## SYNOPSIS

```
#include <Read.h>
Read *read_allocate(
	int num_points,
	int num_bases);
```

```
void read_deallocate(
	Read *read);
```

## DESCRIPTION

**These functions create and destroy Read** structures. The **Read** structure is a generalised in-memory data structure used for holding trace data information.

**read\_allocate()** creates a **Read** structure large enough to hold **num\_points** trace sample points and **num\_bases** called bases. The allocated data is then initialised to appropriate defaults, which are mainly zeros and null pointers.

**read\_deallocate()** destroys a previously created **Read** structure. It is not sufficient to simply use the **free()** call instead.

## RETURN VALUES

On successful completion, the **read\_allocate()** function returns a pointer to a **Read** structure. Otherwise this function returns a null pointer.

The **read\_deallocate()** function returns no value.

## SEE ALSO

[**read\_reading**(3)](/read_reading/3.md), [**fread\_reading**(3)](/fread_reading/3.md), [**write\_reading**(3)](/write_reading/3.md), [**fwrite\_reading**(3)](/fwrite_reading/3.md)
