24 #ifndef PXR_BASE_ARCH_ALIGN_H
25 #define PXR_BASE_ARCH_ALIGN_H
31 #if !defined(__cplusplus)
32 #error This include file can only be included in C++ programs.
36 #include "pxr/base/arch/defines.h"
40 PXR_NAMESPACE_OPEN_SCOPE
54 return (nBytes + 7) & (~0x7);
63 #define ARCH_MAX_ALIGNMENT_INCREASE 7
73 return reinterpret_cast<void *
>
74 ((
reinterpret_cast<uintptr_t
>(base) + 7) & ~0x7);
80 #if defined(ARCH_OS_DARWIN) && defined(ARCH_CPU_ARM)
81 #define ARCH_CACHE_LINE_SIZE 128
83 #define ARCH_CACHE_LINE_SIZE 64
88 PXR_NAMESPACE_CLOSE_SCOPE
90 #endif // PXR_BASE_ARCH_ALIGN_H
void * ArchAlignMemory(void *base)
Align memory to the next "best" alignment value.
size_t ArchAlignMemorySize(size_t nBytes)
Return suitably aligned memory size.