7#ifndef PXR_BASE_WORK_ZERO_ALLOCATOR_H
8#define PXR_BASE_WORK_ZERO_ALLOCATOR_H
16#include <tbb/cache_aligned_allocator.h>
18PXR_NAMESPACE_OPEN_SCOPE
28 using propagate_on_container_move_assignment = std::true_type;
29 using is_always_equal = std::true_type;
31 template<
typename U>
struct rebind {
40 T* allocate(std::size_t n) {
41 T* ptr = tbb::cache_aligned_allocator<T>::allocate(n);
42 std::memset(
static_cast<void*
>(ptr), 0, n *
sizeof(value_type));
47PXR_NAMESPACE_CLOSE_SCOPE
An allocator that provides zero-initialized memory.