Memory Module
+ Collaboration diagram for Memory Module:

Functions

void * jit_getbytes (long size)
 Allocates a pointer to memory.
void jit_freebytes (void *ptr, long size)
 Frees a pointer to memory.
void ** jit_handle_new (long size)
 Allocates a memory handle.
void jit_handle_free (void **handle)
 Frees a memory handle.
long jit_handle_size_get (void **handle)
 Retrieves a memory handle's size in bytes.
t_jit_err jit_handle_size_set (void **handle, long size)
 Sets a memory handle's size in bytes.
long jit_handle_lock (void **handle, long lock)
 Sets a memory handle's lock state.
void jit_copy_bytes (void *dest, const void *src, long bytes)
 Copy bytes from source to destination pointer.
long jit_freemem (void)
 Reports free memory.
char * jit_newptr (long size)
 Allocates a pointer to memory.
void jit_disposeptr (char *ptr)
 Frees a pointer to memory.

Function Documentation

void jit_copy_bytes ( void *  dest,
const void *  src,
long  bytes 
)

Copy bytes from source to destination pointer.

Parameters:
destdestination pointer
srcsource pointer
bytesbyte count to copy
void jit_disposeptr ( char *  ptr)

Frees a pointer to memory.

Warning:
It is important to avoid mixing memory pools, and therefore to match calls to jit_newptr and jit_disposeptr.
Parameters:
ptrpointer to memory
void jit_freebytes ( void *  ptr,
long  size 
)

Frees a pointer to memory.

Depending on the size of the pointer, jit_freebytes will free from either the faster memory pool or the system memory pool.

Warning:
It is important to avoid mixing memory pools, and therefore to match calls to jit_getbytes and jit_freebytes.
Parameters:
ptrpointer to memory
sizesize in bytes allocated
long jit_freemem ( void  )

Reports free memory.

Warning:
Obsolete. OS 9 only.
Returns:
free bytes
void* jit_getbytes ( long  size)

Allocates a pointer to memory.

Depending on the size requested, jit_getbytes will allocate from either the faster memory pool or the system memory pool.

Warning:
It is important to avoid mixing memory pools, and therefore to match calls to jit_getbytes and jit_freebytes.
Parameters:
sizesize in bytes to allocate
Returns:
pointer to memory
void jit_handle_free ( void **  handle)

Frees a memory handle.

Warning:
It is important to avoid mixing memory pools, and therefore to match calls to jit_handle_new and jit_handle_free.
Parameters:
handlememory handle
long jit_handle_lock ( void **  handle,
long  lock 
)

Sets a memory handle's lock state.

Parameters:
handlememory handle
lockstate (1=locked, 0=unlocked)
Returns:
lock state.
void** jit_handle_new ( long  size)

Allocates a memory handle.

Handles are relocatable sections of memory which should be locked before dereferencing, and unlocked when not in use so that they may be relocated as necessary.

Warning:
It is important to avoid mixing memory pools, and therefore to match calls to jit_handle_new and jit_handle_free.
Parameters:
sizesize in bytes to allocate
Returns:
memory handle
long jit_handle_size_get ( void **  handle)

Retrieves a memory handle's size in bytes.

Parameters:
handlememory handle
Returns:
size in bytes
t_jit_err jit_handle_size_set ( void **  handle,
long  size 
)

Sets a memory handle's size in bytes.

Parameters:
handlememory handle
sizenew size in bytes
Returns:
t_jit_err error code.
char* jit_newptr ( long  size)

Allocates a pointer to memory.

Always allocates from the the system memory pool.

Warning:
It is important to avoid mixing memory pools, and therefore to match calls to jit_newptr and jit_disposeptr.
Parameters:
sizesize in bytes to allocate
Returns:
pointer to memory