Function gdal_sys::CPLVirtualMemFileMapNew [] [src]

pub unsafe extern "C" fn CPLVirtualMemFileMapNew(
    fp: *mut VSILFILE,
    nOffset: vsi_l_offset,
    nLength: vsi_l_offset,
    eAccessMode: Type,
    pfnFreeUserData: CPLVirtualMemFreeUserData,
    pCbkUserData: *mut c_void
) -> *mut CPLVirtualMem

Create a new virtual memory mapping from a file.

The file must be a "real" file recognized by the operating system, and not a VSI extended virtual file.

In VIRTUALMEM_READWRITE mode, updates to the memory mapping will be written in the file.

On Linux AMD64 platforms, the maximum value for nLength is 128 TB. On Linux x86 platforms, the maximum value for nLength is 2 GB.

Only supported on Linux for now.

@param fp Virtual file handle. @param nOffset Offset in the file to start the mapping from. @param nLength Length of the portion of the file to map into memory. @param eAccessMode Permission to use for the virtual memory mapping. This must be consistant with how the file has been opened. @param pfnFreeUserData callback that is called when the object is destroyed. @param pCbkUserData user data passed to pfnFreeUserData. @return a virtual memory object that must be freed by CPLVirtualMemFree(), or NULL in case of failure.

@since GDAL 2.0