modules/portlib/src/main/native/port/windows/hymmap.c File Reference


Detailed Description

Memory map.

This module provides memory mapping facilities that allow a user to map files into the virtual address space of the process. There are various options that can be used when mapping a file into memory, such as copy on write. Not all of these options are available on all platforms, hymmap_capabilities provides the list of supported options. Note also that on some platforms memory mapping facilites do not exist at all. On these platforms the API will still be available, but will simply read the file into allocated memory.

#include <windows.h>
#include "hyport.h"

Functions

void *VMCALL hymmap_map_file (struct HyPortLibrary *portLibrary, const char *path, void **handle)
 Map a file into memory.
void VMCALL hymmap_unmap_file (struct HyPortLibrary *portLibrary, void *handle)
 UnMap previously mapped memory.
void VMCALL hymmap_shutdown (struct HyPortLibrary *portLibrary)
 PortLibrary shutdown.
I_32 VMCALL hymmap_startup (struct HyPortLibrary *portLibrary)
 PortLibrary startup.
I_32 VMCALL hymmap_capabilities (struct HyPortLibrary *portLibrary)
 Check the capabilities available for HYMMAP at runtime for the current platform.


Function Documentation

I_32 VMCALL hymmap_capabilities ( struct HyPortLibrary portLibrary  ) 

Check the capabilities available for HYMMAP at runtime for the current platform.

Parameters:
[in] portLibrary The port library
Returns:
a bit map containing the capabilites supported by the hymmap sub component of the port library. Possible bit values: HYPORT_MMAP_CAPABILITY_COPYONWRITE - if not present, platform is not capable of "copy on write" memory mapping.

void* VMCALL hymmap_map_file ( struct HyPortLibrary portLibrary,
const char *  path,
void **  handle 
)

Map a file into memory.

Parameters:
[in] portLibrary The port library
[in] path - the path of the file to mapped into memory.
[out] handle - updates *handle with the memory map handle, this handle is later passed to unmap.
Returns:
pointer to newly mapped memory on success, NULL on error.

void VMCALL hymmap_shutdown ( struct HyPortLibrary portLibrary  ) 

PortLibrary shutdown.

Parameters:
[in] portLibrary The port library
This function is called during shutdown of the portLibrary. Any resources that were created by hymmap_startup should be destroyed here.

I_32 VMCALL hymmap_startup ( struct HyPortLibrary portLibrary  ) 

PortLibrary startup.

This function is called during startup of the portLibrary. Any resources that are required for the memory mapping operations may be created here. All resources created here should be destroyed in hymmap_shutdown.

Parameters:
[in] portLibrary The port library
Returns:
0 on success, negative error code on failure. Error code values returned are
  • HYPORT_ERROR_STARTUP_MMAP
Note:
Most implementations will simply return success.

void VMCALL hymmap_unmap_file ( struct HyPortLibrary portLibrary,
void *  handle 
)

UnMap previously mapped memory.

Parameters:
[in] portLibrary The port library
[in] handle - the handle from the mmap_map_file.


Genereated on Tue Dec 9 14:12:59 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.