---
name: "Ns_ThreadAlloc"
section: "3aolserver"
platform: "linux"
package: "aolserver4-dev"
version: "4.5.1-18.1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/Ns_ThreadAlloc/3aolserver"
---

# Ns\_ThreadAlloc(3aolserver)

Memory allocation functions for threads (deprecated)

```

```

## NAME

Ns\_ThreadAlloc, Ns\_ThreadCalloc, Ns\_ThreadFree, Ns\_ThreadMalloc, Ns\_ThreadPool, Ns\_ThreadRealloc, Ns\_ThreadStrCopy, Ns\_ThreadStrDup - Memory allocation functions for threads (deprecated)

## SYNOPSIS

```
#include "ns.h"

void *
Ns_ThreadAlloc(size_t size)

void *
Ns_ThreadCalloc(size_t nelem, size_t elsize)

void
Ns_ThreadFree(void *ptr)

void *
Ns_ThreadMalloc(size_t size)

Ns_Pool *
Ns_ThreadPool(void)

void *
Ns_ThreadRealloc(void *ptr, size_t size)

char *
Ns_ThreadStrCopy(char *str)

char *
Ns_ThreadStrDup(char *str)
```

## DESCRIPTION

These functions are deprecated and are actually wrappers around other functions. You should use the other functions directly.

- **Ns\_ThreadAlloc**(*size*)

  A wrapper for Ns\_ThreadMalloc.

- **Ns\_ThreadCalloc**(*nelem, elsize*)

  A wrapper for ns\_calloc.

- **Ns\_ThreadFree**(*ptr*)

  A wrapper for ns\_free.

- **Ns\_ThreadMalloc**(*size*)

  A wrapper for ns\_malloc.

- **Ns\_ThreadPool**()

  Deprecated. Always returns a -1.

- **Ns\_ThreadRealloc**(*ptr, size*)

  A wrapper for ns\_realloc.

- **Ns\_ThreadStrCopy**(*str*)

  A wrapper for ns\_strcopy.

- **Ns\_ThreadStrDup**(*str*)

  A wrapper for ns\_strdup.

## SEE ALSO

nsd(1), [info(n)](/info/n.md), [ns\_calloc(3)](/ns_calloc/3.md), [ns\_malloc(3)](/ns_malloc/3.md), [ns\_realloc(3)](/ns_realloc/3.md), [ns\_free(3)](/ns_free/3.md), [ns\_strcopy(3)](/ns_strcopy/3.md), [ns\_strdup(3)](/ns_strdup/3.md)

## KEYWORDS
