tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

pr_memmap.rst (969B)


      1 PR_MemMap
      2 =========
      3 
      4 Maps a section of a file to memory.
      5 
      6 
      7 Syntax
      8 ------
      9 
     10 .. code::
     11 
     12   #include <prio.h>
     13 
     14   void* PR_MemMap(
     15     PRFileMap *fmap,
     16     PRInt64 offset,
     17     PRUint32 len);
     18 
     19 
     20 Parameters
     21 ~~~~~~~~~~
     22 
     23 The function has the following parameters:
     24 
     25 ``fmap``
     26   A pointer to the file-mapping object representing the file to be
     27   memory-mapped.
     28 ``offset``
     29   The starting offset of the section of file to be mapped. The offset
     30   must be aligned to whole pages.
     31 ``len``
     32   Length of the section of the file to be mapped.
     33 
     34 
     35 Returns
     36 ~~~~~~~
     37 
     38 The starting address of the memory region to which the section of file
     39 is mapped. Returns ``NULL`` on error.
     40 
     41 
     42 Description
     43 -----------
     44 
     45 :ref:`PR_MemMap` maps a section of the file represented by the file mapping
     46 ``fmap`` to memory. The section of the file starts at ``offset`` and has
     47 the length ``len``.
     48 
     49 When the file-mapping memory region is no longer needed, it should be
     50 unmapped with a call to :ref:`PR_MemUnmap`.