TuttleOFX  1
OFX::memory Namespace Reference

Namespace for general purpose memory allocation. More...

Functions

void * allocate (const std::size_t nBytes, ImageEffect *handle=0) throw ( std::bad_alloc )
 Allocate memory.
void free (void *ptr) throw ()
 release memory

Detailed Description

Namespace for general purpose memory allocation.

namespace for memory allocation that is done via wrapping the ofx memory suite


Function Documentation

void * OFX::memory::allocate ( const std::size_t  nBytes,
ImageEffect *  handle = 0 
) throw ( std::bad_alloc )

Allocate memory.

allocate n bytes, returns a pointer to it

  • nBytes - the number of bytes to allocate
  • handle - effect instance to assosciate with this memory allocation, or NULL

This function has the host allocate memory using it's own memory resources and returns that to the plugin. This memory is distinct to any image memory allocation.

Suceeds or throws std::bad_alloc

Definition at line 99 of file ofxsCore.cpp.

References OFX::Private::gMemorySuite, kOfxStatOK, and OfxMemorySuiteV1::memoryAlloc.

Referenced by tuttle::io::J2KReader::open(), and tuttle::host::ImageEffectNode::process().

void OFX::memory::free ( void *  ptr) throw ()