1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-20 04:50:55 -07:00

More design.

Copied from Perforce
 Change: 187365
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2014-10-23 14:25:52 +01:00
parent e982ef8b64
commit f42a04c49b
2 changed files with 25 additions and 18 deletions

View file

@ -249,13 +249,12 @@ can reach by following references of the third, second, and first
ranks. And so on. The description of the tracer working like this
originated in [RHSK_2007-06-25]_.
A trace keep track of which band it is tracing. This is returned by
A trace keeps track of which band it is tracing. This is returned by
the ``TraceBand()`` method. Keeping this band information helps it
implement the semantics of finalization and weakness. The band used to
not be explicitly stored, but this hindered the implementation of good
finalization semantics (essentially in some circumstances finalization
messages were delayed by at least one collection cycle, see
job001658_.
finalization semantics (in some circumstances finalization messages
were delayed by at least one collection cycle: see job001658_).
.. _job001658: https://info.ravenbrook.com/project/mps/issue/job001658/

View file

@ -111,22 +111,21 @@ the ground.)
_`.req.params`: The interface should make it possible for MPS to allow
the client program to modify the behaviour of the virtual mapping
implementation. (This is needed to implement the
``MPS_KEY_VMW3_MEM_TOP_DOWN`` keyword argument, which allows a client
program on Windows to tell the virtual mapping module to pass the
``MEM_TOP_DOWN`` flag to ``VirtualAlloc()``.)
``MPS_KEY_VMW3_MEM_TOP_DOWN`` keyword argument.)
Design
------
_`.sol.overhead`: To meet `.req.contiguous`_, `.req.align`_ and
`.req.overhead`_, most VM implementations ask the operating system for
``size + grainSize - pageSize`` bytes of address space. This ensures
that wherever the operating system places the reserved address space,
it contains a continguous region of ``size`` bytes aligned to a
multiple of ``grainSize``. The overhead is thus ``grainSize -
pageSize``, and in the common case where ``grainSize`` is equal to
``pageSize``, this is zero.
_`.sol.overhead`: To meet `.req.reserve.contiguous`_,
`.req.reserve.align`_ and `.req.reserve.overhead`_, most VM
implementations ask the operating system for ``size + grainSize -
pageSize`` bytes of address space. This ensures that wherever the
operating system places the reserved address space, it contains a
continguous region of ``size`` bytes aligned to a multiple of
``grainSize``. The overhead is thus ``grainSize - pageSize``, and in
the common case where ``grainSize`` is equal to ``pageSize``, this is
zero.
_`.sol.bootstrap`: To meet `.req.bootstrap`_, the interface provides
the function ``VMCopy()``. This allows the initialization of a
@ -241,6 +240,8 @@ _`.impl.an`: In ``vman.c``.
_`.impl.an.page.size`: The generic VM uses a fake page size, given by
the constant ``VMAN_PAGE_SIZE`` in ``config.h``.
_`.impl.an.param`: Decodes no keyword arguments.
_`.impl.an.reserve`: Address space is "reserved" by calling
``malloc()``.
@ -252,13 +253,15 @@ with copies of ``VMJunkBYTE`` to emulate the erasure of freshly mapped
pages by virtual memory systems.
POSIX implementation
....................
Unix implementation
...................
_`.impl.ix`: In ``vmix.c``.
_`.impl.ix.page.size`: The page size is given by ``getpagesize()``.
_`.impl.ix.param`: Decodes no keyword arguments.
_`.impl.ix.reserve`: Address space is reserved by calling |mmap|_,
passing ``PROT_NONE`` and ``MAP_PRIVATE | MAP_ANON``.
@ -296,8 +299,13 @@ _`.impl.w3.page.size`: The page size is retrieved by calling
.. |GetSystemInfo| replace:: ``GetSystemInfo()``
.. _GetSystemInfo: http://msdn.microsoft.com/en-gb/library/windows/desktop/ms724381.aspx
_`.impl.w3.param`: Decodes the keyword argument
``MPS_KEY_VMW3_MEM_TOP_DOWN``, and if it is set, arranges for
``VMInit()`` to pass the ``MEM_TOP_DOWN`` flag to |VirtualAlloc|_.
_`.impl.w3.reserve`: Address space is reserved by calling
|VirtualAlloc|_, passing ``PAGE_NOACCESS``.
|VirtualAlloc|_, passing ``MEM_RESERVE`` (and optionally
``MEM_TOP_DOWN``) and ``PAGE_NOACCESS``.
.. |VirtualAlloc| replace:: ``VirtualAlloc()``
.. _VirtualAlloc: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366887.aspx