Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::use_only_in_tests Namespace Reference

Typedefs

template<typename T , size_t alignment_bytes, size_t misalignment_bytes>
using MisalignedAllocator
 
template<typename T , size_t alignment_bytes, size_t misalignment_bytes>
using MisalignedVector
 

Detailed Description

Intentionally misaligned containers for testing correctness and performance of code that may depend on a certain alignment.

Typedef Documentation

◆ MisalignedAllocator

template<typename T , size_t alignment_bytes, size_t misalignment_bytes>
using operations_research::use_only_in_tests::MisalignedAllocator
Initial value:
internal::AllocatorWithAlignment<T, alignment_bytes, misalignment_bytes>

A version of AlignedAllocator for testing purposes that adds intentional misalignment. The returned address has the form alignment_bytes * N + misalignment_bytes.

Definition at line 88 of file aligned_memory.h.

◆ MisalignedVector

template<typename T , size_t alignment_bytes, size_t misalignment_bytes>
using operations_research::use_only_in_tests::MisalignedVector
Initial value:
std::vector<T, MisalignedAllocator<T, alignment_bytes, misalignment_bytes>>

A specialization of std::vector<> that uses MisalignedAllocator with the given parameters.

Definition at line 94 of file aligned_memory.h.