Keywords: allocator, scalable_allocator

# scalable_allocator Template Class

## Summary

Template class for scalable memory allocation.

## Syntax

    template<typename T> class scalable_allocator;

## Header

    #include "tbb/scalable_allocator.h"

## Description

A `scalable_allocator` allocates and frees memory in a way that scales with the number of processors. A `scalable_allocator` models the Allocator Concept. Using a `scalable_allocator` in place of `std::allocator` may improve program performance. Memory allocated by a scalable_allocator should be freed by a `scalable_allocator`, not by a `std::allocator`.

### Caution

The `scalable_allocator` requires that the tbb malloc library be available. If the library is missing, calls to the scalable allocator fail. In contrast, `tbb_allocator` falls back on `malloc` and free if the tbbmalloc library is missing.

## Members

See Allocator concept.

## Acknowledgement

The scalable memory allocator incorporates McRT technology developed by Intel's PSL CTG team.

Parent topic: Memory Allocation

- C Interface to Scalable Allocator

## See Also

Allocator Concept