rvm_unmap(3)

NAME
rvm_unmap - unmap segment region

SYNOPSIS

#include "rvm.h"
typedef struct
    {
    char            *data_dev;
    rvm_offset_t    dev_length;
    rvm_offset_t    offset;
    char            *vmaddr;
    rvm_length_t    length;
    bool            no_copy;
    }
rvm_region_t;
rvm_return_t rvm_unmap (region)
rvm_region_t *region;   /* pointer to region descriptor */

DESCRIPTION
rvm_unmap releases mapped buffers. The virtual memory space is freed for other uses, but not returned to Unix. This is true even if the space was allocated by rvm_map, in which case attempts to deallocate it with free will result in error. If the space was originally allocated from the heap by the application, using free is permissible. If vmaddr is invalid, length is zero, or the range is not within valid virtual memory limits, RVM_ERANGE is returned. The address range must represent a mapped region of a segment, otherwise RVM_ENOT_MAPPED is returned. The region unmapped must be the same as that mapped, or RVM_ERANGE or RVM_ENOT_MAPPED, as appropriate, will be returned. A region cannot be split by unmapping part of it. Use of the region descriptor as returned by rvm_map for the region is recommended. Before a region of a segment can be unmapped, there must be no uncommitted transactions affecting that region. RVM checks this and will return the code RVM_EUNCOMMIT if any exist. The function rvm_query can be used to discover the uncommitted transaction (s). Discovery of an uncommitted transaction in a region to be unmapped is a likely indicator of program logic errors. Invoking log truncation after unmapping modified regions will avoid delay in mapping if those regions are expected to be remapped. If several regions are unmapped, truncation after the last unmapped will insure no mapping delay if any are remapped.

DIAGNOSTICS

RVM_SUCCESS
    success

RVM_EREGION
    invalid region descriptor or pointer

RVM_ERANGE
    virtual memory address range does not match mapped region

RVM_EUNCOMMIT
    uncommitted transaction(s) pending

RVM_ENOT_MAPPED
    designated region not mapped

RVM_EINIT
    RVM not initialized

SEE ALSO
rvm_map (3), rvm_set_options (3), and rvm_query (3)

AUTHOR
Hank Mashburn