Table 20-2 lists the memory services functions that are described in this section.
Table 20-2 Memory Services Functions
Function | Purpose |
---|---|
Start a user duration |
|
Terminate a user duration |
|
Allocate memory of a given size from a given duration |
|
Free a memory chunk |
|
Resize a memory chunk |
See Also:
Oracle Database Data Cartridge Developer's Guide for more information about using these functionssword OCIDurationBegin ( OCIEnv *env, OCIError *err, const OCISvcCtx *svc, OCIDuration parent, OCIDuration *duration );
The OCI environment handle. This should be passed as NULL
for cartridge services.
The OCI error handle. If there is an error, it is recorded in err
, and this function returns OCI_ERROR
. Diagnostic information can be obtained by calling OCIErrorGet().
The OCI service context handle.
The duration number of the parent duration. It is one of the following:
An identifier unique to the newly created user duration.
This function starts a user duration. A user can have multiple active user durations simultaneously. The user durations do not have to be nested. The duration
parameter is used to return a number that uniquely identifies the duration created by this call.
Note that the environment and service context parameters cannot both be NULL
.
sword OCIDurationEnd ( OCIEnv *env, OCIError *err, const OCISvcCtx *svc, OCIDuration duration );
The OCI environment handle.
The OCI error handle. If there is an error, it is recorded in err
, and this function returns OCI_ERROR
. Diagnostic information can be obtained by calling OCIErrorGet().
OCI service context (this should be passed as NULL
for cartridge services; otherwise, it should be non-NULL
).
A user duration previously created by OCIDurationBegin()
.
This function terminates a user duration.
Note that the environment and service context parameters cannot both be NULL
.
sword OCIMemoryAlloc( void *hndl, OCIError *err, void **mem, OCIDuration dur, ub4 size, ub4 flags );
The OCI environment handle (OCIEnv *
) if dur
is OCI_DURATION_PROCESS
; otherwise, the user session handle (OCISession *
).
The error handle.
Memory allocated.
A previously created user duration or one of these values:
OCI_DURATION_CALLOUT
OCI_DURATION_STATEMENT
OCI_DURATION_SESSION
OCI_DURATION_PROCESS
Size of memory to be allocated.
Set the OCI_MEMORY_CLEARED
bit to get memory that has been cleared.
To allocate memory for the duration of the callout of the agent, that is, external procedure duration, use OCIExtProcAllocCallMemory() or OCIMemoryAlloc()
with dur
as OCI_DURATION_CALLOUT
.
The OCI environment or user session handle.
The error handle.
Pointer to memory allocated previously using OCIMemoryAlloc().
The OCI environment or user session handle.
The error handle.
Pointer to memory allocated previously using OCIMemoryAlloc().
Size of memory requested.
Set the OCI_MEMORY_CLEARED
bit to get memory that has been cleared.