|
Ptex
|
Platform-specific classes, functions, and includes. More...
#include "PtexInt.h"#include <stdlib.h>#include <alloca.h>#include <string.h>#include <pthread.h>#include <stdio.h>#include <math.h>#include <assert.h>#include "PtexVersion.h"Go to the source code of this file.
Classes | |
| class | Mutex |
| class | SpinLock |
| struct | AtomicCompareAndSwapImpl< T, sizeof(uint32_t)> |
| struct | AtomicCompareAndSwapImpl< T, sizeof(uint64_t)> |
Macros | |
| #define | PTEX_PLATFORM_UNIX |
| #define | ATOMIC_ALIGNED __attribute__((aligned(8))) |
| #define | ATOMIC_ADD32(x, y) |
| #define | ATOMIC_ADD64(x, y) |
| #define | ATOMIC_SUB32(x, y) |
| #define | ATOMIC_SUB64(x, y) |
| #define | MEM_FENCE() |
| #define | BOOL_CMPXCH32(x, y, z) |
| #define | BOOL_CMPXCH64(x, y, z) |
| #define | PTEX_INLINE inline __attribute__((always_inline)) |
| #define | CACHE_LINE_SIZE 64 |
| #define | CACHE_LINE_PAD(var, type) |
| #define | CACHE_LINE_PAD_INIT(var) |
Typedefs | |
| typedef off_t | FilePos |
Functions | |
| template<typename T> | |
| PTEX_INLINE T | AtomicAdd (volatile T *target, T value) |
| template<typename T> | |
| PTEX_INLINE T | AtomicIncrement (volatile T *target) |
| template<typename T> | |
| PTEX_INLINE T | AtomicSubtract (volatile T *target, T value) |
| template<typename T> | |
| PTEX_INLINE T | AtomicDecrement (volatile T *target) |
| template<typename T> | |
| PTEX_INLINE bool | AtomicCompareAndSwap (T volatile *target, T oldvalue, T newvalue) |
| template<typename T> | |
| PTEX_INLINE void | AtomicStore (T volatile *target, T value) |
| PTEX_INLINE void | PtexMemoryFence () |
Platform-specific classes, functions, and includes.
Definition in file PtexPlatform.h.
| #define ATOMIC_ADD32 | ( | x, | |
| y ) |
Definition at line 193 of file PtexPlatform.h.
Referenced by AtomicAdd().
| #define ATOMIC_ADD64 | ( | x, | |
| y ) |
Definition at line 194 of file PtexPlatform.h.
Referenced by AtomicAdd().
| #define ATOMIC_ALIGNED __attribute__((aligned(8))) |
Definition at line 192 of file PtexPlatform.h.
| #define ATOMIC_SUB32 | ( | x, | |
| y ) |
Definition at line 195 of file PtexPlatform.h.
Referenced by AtomicSubtract().
| #define ATOMIC_SUB64 | ( | x, | |
| y ) |
Definition at line 196 of file PtexPlatform.h.
Referenced by AtomicSubtract().
| #define BOOL_CMPXCH32 | ( | x, | |
| y, | |||
| z ) |
Definition at line 198 of file PtexPlatform.h.
Referenced by AtomicCompareAndSwapImpl< T, sizeof(uint32_t)>::operator()().
| #define BOOL_CMPXCH64 | ( | x, | |
| y, | |||
| z ) |
Definition at line 199 of file PtexPlatform.h.
Referenced by AtomicCompareAndSwapImpl< T, sizeof(uint64_t)>::operator()().
| #define CACHE_LINE_PAD | ( | var, | |
| type ) |
Definition at line 300 of file PtexPlatform.h.
| #define CACHE_LINE_PAD_INIT | ( | var | ) |
Definition at line 301 of file PtexPlatform.h.
Referenced by PtexReaderCache::PtexReaderCache().
| #define CACHE_LINE_SIZE 64 |
Definition at line 297 of file PtexPlatform.h.
| #define MEM_FENCE | ( | ) |
Definition at line 197 of file PtexPlatform.h.
Referenced by AtomicStore(), and PtexMemoryFence().
| #define PTEX_INLINE inline __attribute__((always_inline)) |
Definition at line 202 of file PtexPlatform.h.
Referenced by AtomicAdd(), AtomicCompareAndSwap(), AtomicDecrement(), AtomicIncrement(), AtomicStore(), AtomicSubtract(), AtomicCompareAndSwapImpl< T, sizeof(uint32_t)>::operator()(), AtomicCompareAndSwapImpl< T, sizeof(uint64_t)>::operator()(), and PtexMemoryFence().
| #define PTEX_PLATFORM_UNIX |
Definition at line 83 of file PtexPlatform.h.
| typedef off_t FilePos |
Definition at line 99 of file PtexPlatform.h.
| PTEX_INLINE T AtomicAdd | ( | volatile T * | target, |
| T | value ) |
Definition at line 209 of file PtexPlatform.h.
References ATOMIC_ADD32, ATOMIC_ADD64, and PTEX_INLINE.
Referenced by PtexReaderCache::adjustFilesOpen(), PtexReaderCache::adjustMemUsed(), AtomicIncrement(), and PtexReader::increaseMemUsed().
| PTEX_INLINE bool AtomicCompareAndSwap | ( | T volatile * | target, |
| T | oldvalue, | ||
| T | newvalue ) |
Definition at line 278 of file PtexPlatform.h.
References PTEX_INLINE.
Referenced by PtexReader::TiledReducedFace::getTile(), PtexHashMap< StringKey, PtexCachedReader * >::lockEntries(), PtexCachedReader::ref(), and PtexCachedReader::trylock().
| PTEX_INLINE T AtomicDecrement | ( | volatile T * | target | ) |
Definition at line 247 of file PtexPlatform.h.
References AtomicSubtract(), and PTEX_INLINE.
Referenced by PtexCachedReader::unref().
| PTEX_INLINE T AtomicIncrement | ( | volatile T * | target | ) |
Definition at line 225 of file PtexPlatform.h.
References AtomicAdd(), and PTEX_INLINE.
Referenced by PtexReader::logBlockRead(), PtexReader::logOpen(), and PtexReaderCache::logRecentlyUsed().
| PTEX_INLINE void AtomicStore | ( | T volatile * | target, |
| T | value ) |
Definition at line 284 of file PtexPlatform.h.
References MEM_FENCE, and PTEX_INLINE.
Referenced by PtexReader::open(), PtexReaderCache::processMru(), PtexReader::readFaceData(), PtexReader::readLevel(), PtexReader::readMetaData(), PtexCachedReader::unlock(), and PtexHashMap< StringKey, PtexCachedReader * >::unlockEntries().
| PTEX_INLINE T AtomicSubtract | ( | volatile T * | target, |
| T | value ) |
Definition at line 231 of file PtexPlatform.h.
References ATOMIC_SUB32, ATOMIC_SUB64, and PTEX_INLINE.
Referenced by AtomicDecrement().
| PTEX_INLINE void PtexMemoryFence | ( | ) |
Definition at line 290 of file PtexPlatform.h.
References MEM_FENCE, and PTEX_INLINE.
Referenced by PtexHashMap< StringKey, PtexCachedReader * >::tryInsert().