8#ifndef PXR_ARCH_ALIGN_H
9#define PXR_ARCH_ALIGN_H
14#if !defined(__cplusplus)
15#error This include file can only be included in C++ programs.
34 return (nBytes + 7) & (~0x7);
43#define ARCH_MAX_ALIGNMENT_INCREASE 7
53 return reinterpret_cast<void *
>
54 ((
reinterpret_cast<uintptr_t
>(base) + 7) & ~0x7);
60#if defined(ARCH_OS_DARWIN) && defined(ARCH_CPU_ARM)
61#define ARCH_CACHE_LINE_SIZE 128
63#define ARCH_CACHE_LINE_SIZE 64
ARCH_API void * ArchAlignedAlloc(size_t alignment, size_t size)
Aligned memory allocation.
size_t ArchAlignMemorySize(size_t nBytes)
Return suitably aligned memory size.
Definition align.h:33
ARCH_API void ArchAlignedFree(void *ptr)
Free memory allocated by ArchAlignedAlloc.
void * ArchAlignMemory(void *base)
Align memory to the next "best" alignment value.
Definition align.h:51