next up previous contents index
Next: 5.4.3 wire: Wire a Up: 5.4 oskit_bufio: Buffer-based I/O Previous: 5.4.1 map: Map some

5.4.2 unmap: Release a previously mapped region of this buffer

 

SYNOPSIS

#include <oskit/io/bufio.h>

OSKIT_COMDECL unmap(oskit_bufio_t *io, void *addr, oskit_off_t offset, oskit_size_t amount);

DESCRIPTION

After a successful call to the map method, the client should call this method after it is finished accessing the buffer directly, so that the buffer object can clean up and free any resources that might be associated with the mapping.

The addr parameter passed to this method must be exactly the value returned by the map request, and the offset and amount parameters must be exactly the same as the values previously passed in the corresponding map call. In other words, clients must only attempt to unmap whole regions; they must not attempt to unmap only part of a region, or to unmap two previously mapped regions in one call, even if the two regions appear to be contiguous in memory.

PARAMETERS

io
The object whose contents are to be mapped.
addr
The address of the mapped region, as returned from the corresponding map call.
offset
The offset into the buffer of the mapped region, as passed to the corresponding map call.
size
The size of the mapped region, as passed to the corresponding map call.

RETURNS

Returns 0 on success, or an error code specified in <oskit/error.h>, on error.



University of Utah Flux Research Group