RixMemoryPool Class Reference
RixMemoryPool Class Referenceabstract
#include <RixInterfaces.h>
Inheritance diagram for RixMemoryPool:
Public Types | |
enum | BlockLifetime { k_EvaluationLifetime, k_ShadeContextLifetime } |
Public Member Functions | |
virtual void * | Allocate (size_t numbytes, BlockLifetime)=0 |
Public Member Functions inherited from RixInterface | |
virtual int | GetVersion () const |
Additional Inherited Members | |
Protected Member Functions inherited from RixInterface | |
RixInterface (int version) | |
Interfaces should not be constructed by users. | |
virtual | ~RixInterface () |
Interfaces should not be deleted by users. | |
Protected Attributes inherited from RixInterface | |
int | m_version |
Version number of this interface. | |
Detailed Description
An interface for allocating memory from a memory pool for the purposes of shading. Due to the repetitive, recursive and threaded nature of shader execution, it may be faster and easier to allocate memory from this pool rather than the standard malloc heap. The constraints imposed by this memory allocator are:
- you shouldn't retain a reference to allocated memory beyond the advertised lifetime
- you shouldn't free, delete or release the memory (it's automatic)
- you should use 'placement new' to assign the allocated memory blocks for use by C++ objects.
- no destructors will be called on any C++ objects in the block.
- this interface isn't available in RIS mode, you should rely on the built-in memory services of RixIntegratorContext and RixShadingContext.
The documentation for this class was generated from the following file: