12#ifndef ARCCORE_COMMON_ALIGNEDMEMORYALLOCATOR_H
13#define ARCCORE_COMMON_ALIGNEDMEMORYALLOCATOR_H
17#include "arccore/common/IMemoryAllocator.h"
30 extern "C++" ARCCORE_COMMON_EXPORT
size_t
31 adjustMemoryCapacity(
size_t wanted_capacity,
size_t element_size);
44class ARCCORE_COMMON_EXPORT AlignedMemoryAllocator
49 static AlignedMemoryAllocator SimdAllocator;
50 static AlignedMemoryAllocator CacheLineAllocator;
77 static AlignedMemoryAllocator*
Simd()
79 return &SimdAllocator;
87 return &CacheLineAllocator;
93 : m_alignment(static_cast<size_t>(alignment))
Memory allocator with specific memory alignment.
size_t guaranteedAlignment(MemoryAllocationArgs) const override
Value of the alignment guaranteed by the allocator.
static AlignedMemoryAllocator * CacheLine()
Allocator guaranteeing alignment to a cache line.
eMemoryResource memoryResource() const override
Memory resource provided by the allocator.
static constexpr Integer simdAlignment()
Alignment for structures using vectorization.
static AlignedMemoryAllocator * Simd()
Allocator guaranteeing alignment to use vectorization on the target platform.
bool hasRealloc(MemoryAllocationArgs) const override
Indicates whether the allocator supports realloc semantics.
static constexpr Integer cacheLineAlignment()
Alignment for a cache line.
Information about an allocated memory region.
Interface for a memory allocator.
Class containing information to specialize allocations.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
eMemoryResource
List of available memory resources.
@ Host
Allocates on the host.
std::int32_t Int32
Signed integer type of 32 bits.