10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Environment Class<br />

method. If no memory manager functions are specified, then OCCI uses its own<br />

default functions. An Environment object must eventually be closed to free all the<br />

system resources it has acquired.<br />

If the mode specified is THREADED_MUTEXED or THREADED_UN_MUTEXED,<br />

then all three memory management functions must be thread-safe.<br />

Syntax<br />

static Environment * createEnvironment(Mode mode = DEFAULT,<br />

void *ctxp = 0,<br />

void *(*malocfp)(void *ctxp, size_t size) = 0,<br />

void *(*ralocfp)(void *ctxp, void *memptr, size_t newsize) = 0,<br />

void (*mfreefp)(void *ctxp, void *memptr) = 0);<br />

Parameters<br />

mode<br />

Valid values are:<br />

DEFAULT not thread safe, not in object mode<br />

THREADED_MUTEXED thread safe, mutexed internally by OCCI<br />

THREADED_UN-MUTEXTED thread safe, client responsible for mutexing<br />

OBJECT uses object features<br />

ctxp<br />

Context pointer for user-defined memory management function.<br />

size_t<br />

The size of the memory to be allocated by user-defined memory allocation function.<br />

malocfp<br />

User-defined memory allocation function.<br />

ralocfp<br />

User-defined memory reallocation function.<br />

mfreefp<br />

User-defined memory free function.<br />

OCCI Classes and Methods 8-65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!