Pixar Arch
Loading...
Searching...
No Matches
align.h File Reference

Provide architecture-specific memory-alignment information. More...

#include "./api.h"
#include "./defines.h"
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Namespaces

namespace  pxr
 

Macros

#define ARCH_MAX_ALIGNMENT_INCREASE
 Maximum extra space needed for alignment.
 
#define ARCH_CACHE_LINE_SIZE
 The size of a CPU cache line on the current processor architecture in bytes.
 

Functions

size_t pxr::ArchAlignMemorySize (size_t nBytes)
 Return suitably aligned memory size.
 
void * pxr::ArchAlignMemory (void *base)
 Align memory to the next "best" alignment value.
 
ARCH_API void * pxr::ArchAlignedAlloc (size_t alignment, size_t size)
 Aligned memory allocation.
 
ARCH_API void pxr::ArchAlignedFree (void *ptr)
 Free memory allocated by ArchAlignedAlloc.
 

Detailed Description

Provide architecture-specific memory-alignment information.

Macro Definition Documentation

◆ ARCH_MAX_ALIGNMENT_INCREASE

#define ARCH_MAX_ALIGNMENT_INCREASE

Maximum extra space needed for alignment.

The ArchAlignMemorySize() can increase the required memory by no more than ARCH_MAX_ALIGNMENT_INCREASE.

◆ ARCH_CACHE_LINE_SIZE

#define ARCH_CACHE_LINE_SIZE

The size of a CPU cache line on the current processor architecture in bytes.