scalable_memory_resource Function

Summary

Function that returns a memory resource for scalable memory allocation.

Syntax

std::pmr::memory_resource* scalable_memory_resource();

Header

#include "tbb/scalable_allocator.h"

Description

The scalable_memory_resource() function returns the pointer to the memory resource managed by the TBB scalable memory allocator. In particular, its allocate method uses scalable_aligned_malloc(), and deallocate uses scalable_free(). The memory resources returned by this function compare equal.

std::pmr::polymorphic_allocator instantiated with tbb::scalable_memory_resource() behaves like tbb::scalable_allocator.

For more complete information about compiler optimizations, see our Optimization Notice.