M(3)

PACKAGE
m - Routines to manipulate memory blocks

PURPOSE
These routines are meant to provide a better memory allocation service than the malloc(3) call. The supplied allocation and deallocation routines perform periodic checks to see if array boundaries have been overrun. A set of memory manipulation and error message routines are also provided in this package.

LIBRARY
karma

LINK WITH
-lkarma

FUNCTIONS

m_test_access
    Test if a block of memory is accessible.

m_alloc
    Allocate Virtual Memory.

m_alloc_no_checks
    Allocate Virtual Memory.

m_free
    Free Virtual Memory.

m_abort
    Print memory error notification message and abort.

m_verify_memory_integrity
    Periodically verify memory integrity.

m_get_total_allocated
    Get total number of bytes currently allocated.

m_trap_allocations
    Trap memory allocations within a certain range and abort.

m_clear
    Clear a block of memory

m_calloc
    Allocate Virtual Memory and initialise with zeros.

m_free2
    Free Virtual Memory.

m_copy
    Copy a block of memory.

m_copy_blocks
    Copy multiple blocks of data.

m_copy_and_swap_blocks
    Copy and byte-swap multiple blocks of data.

m_fill
    Fill memory blocks with a specified value.

m_cmp
    Compare two blocks of memory.

m_dup
    Duplicate a block of memory into a freshly allocated block.

m_alloc_scratch
    Allocate a block of scratch memory.

m_free_scratch
    Free the scratch memory.

m_free_and_clear_pointer
    Free and clear pointer to a pointer.

m_error_notify
    Print memory error notification message.

m_map_fd
    Map a file descriptor

m_unmap
    Unmap a region of memory.

m_map_test
    Test if memory mapping is supported.

m_shm_test_if_available
    Test if shared memory available.

m_shm_alloc
    Allocate a shared memory segment.

m_shm_delete
    Delete a shared memory segment.

m_shm_attach
    Attach a shared memory segment to the process address space.

m_shm_detach
    Detach a shared memory segment from the process address space.

TABLE m_ENVIRONMENT
List of environment variables
Variable Meaning
M_ALLOC_MAX_CHECK_INTERVAL Interval between consistency checks
M_ALLOC_DEBUG If TRUE, enable verbose debugging
M_ALLOC_FAST If TRUE, skip consistency checks
M_ALLOC_ABORT If TRUE, memory errors cause an abort

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/