Memory Module
+ Collaboration diagram for Memory Module:

Functions

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

Detailed Description

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

References sysmem_copyptr().

+ Here is the call graph for this function:

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

References sysmem_freeptr().

+ Here is the call graph for this function:

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

References sysmem_freeptr().

Referenced by jit_glchunk_delete(), jit_matrix_freedata(), jit_ob3d_free(), and max_jit_obex_free().

+ Here is the call graph for this function:

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

References sysmem_newptr().

Referenced by jit_glchunk_copy(), jit_glchunk_grid_new(), jit_glchunk_new(), jit_matrix_getcell(), jit_ob3d_new(), jit_ob3d_setup(), max_jit_classex_setup(), and max_jit_obex_new().

+ Here is the call graph for this function:

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

References sysmem_freehandle().

Referenced by jit_matrix_free().

+ Here is the call graph for this function:

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.

References sysmem_lockhandle().

+ Here is the call graph for this function:

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

References sysmem_newhandle().

+ Here is the call graph for this function:

long jit_handle_size_get ( void **  handle)

Retrieves a memory handle's size in bytes.

Parameters
handlememory handle
Returns
size in bytes

References sysmem_handlesize().

+ Here is the call graph for this function:

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.

References sysmem_resizehandle().

+ Here is the call graph for this function:

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

References sysmem_newptr().

+ Here is the call graph for this function:

  Copyright © 2015, Cycling '74