mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-23 21:37:34 +00:00
Link directly to allocation point protocol reference instead of via glossary.
Copied from Perforce Change: 180043 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
e5931a8edd
commit
7feacf0602
3 changed files with 26 additions and 25 deletions
|
|
@ -231,7 +231,8 @@ Memory Management Glossary: I
|
|||
|
||||
.. mps:specific::
|
||||
|
||||
This is achieved by the :term:`allocation point protocol`.
|
||||
This is achieved by the
|
||||
:ref:`topic-allocation-point-protocol`.
|
||||
|
||||
inline allocation (2)
|
||||
|
||||
|
|
|
|||
|
|
@ -1035,9 +1035,10 @@ MPS attempts to scan ``obj`` at the indicated point, the object's
|
|||
``type`` field will be uninitialized, and so the :term:`scan method`
|
||||
may abort.
|
||||
|
||||
The MPS solves this problem via the :term:`allocation point protocol`.
|
||||
This needs an additional structure, an :term:`allocation point`, to be
|
||||
attached to the pool by calling :c:func:`mps_ap_create`::
|
||||
The MPS solves this problem via the
|
||||
:ref:`topic-allocation-point-protocol`. This needs an additional
|
||||
structure, an :term:`allocation point`, to be attached to the pool by
|
||||
calling :c:func:`mps_ap_create`::
|
||||
|
||||
static mps_ap_t obj_ap;
|
||||
|
||||
|
|
@ -1091,8 +1092,8 @@ we have to initialize the object again (most conveniently done via a
|
|||
|
||||
.. note::
|
||||
|
||||
1. When using the allocation point protocol it is up to you to
|
||||
ensure that the requested size is aligned, because
|
||||
1. When using the :ref:`topic-allocation-point-protocol` it is up
|
||||
to you to ensure that the requested size is aligned, because
|
||||
:c:func:`mps_reserve` is on the MPS's :term:`critical path`,
|
||||
and so it is highly optimized: in nearly all cases it is just
|
||||
an increment to a pointer.
|
||||
|
|
|
|||
|
|
@ -86,8 +86,7 @@ Allocation points
|
|||
free>` allocation. They allow code to allocate without calling an
|
||||
allocation function: this is vital for performance in languages or
|
||||
programs that allocate many small objects. They must be used according
|
||||
to the :ref:`allocation point protocol
|
||||
<topic-allocation-point-protocol>`.
|
||||
to the :ref:`topic-allocation-point-protocol`.
|
||||
|
||||
.. c:type:: mps_ap_t
|
||||
|
||||
|
|
@ -143,8 +142,8 @@ to the :ref:`allocation point protocol
|
|||
|
||||
.. _topic-allocation-point-protocol:
|
||||
|
||||
The allocation point protocol
|
||||
-----------------------------
|
||||
Allocation point protocol
|
||||
-------------------------
|
||||
|
||||
This protocol is designed to work with :term:`incremental garbage
|
||||
collection` and multiple :term:`threads <thread>`, where between any
|
||||
|
|
@ -267,7 +266,7 @@ It is not necessary to worry about going around this loop many times:
|
|||
.. note::
|
||||
|
||||
:c:func:`mps_reserve` must only be called according to the
|
||||
:term:`allocation point protocol`.
|
||||
:ref:`topic-allocation-point-protocol`.
|
||||
|
||||
:c:func:`mps_reserve` is implemented as a macro for speed. It
|
||||
may evaluate its arguments multiple times.
|
||||
|
|
@ -326,7 +325,7 @@ It is not necessary to worry about going around this loop many times:
|
|||
.. note::
|
||||
|
||||
:c:func:`mps_commit` must only be called according to the
|
||||
:term:`allocation point protocol`.
|
||||
:ref:`topic-allocation-point-protocol`.
|
||||
|
||||
:c:func:`mps_commit` is implemented as a macro for speed. It
|
||||
may evaluate its arguments multiple times.
|
||||
|
|
@ -571,21 +570,21 @@ branch prediction should work well since the test almost never fails).
|
|||
|
||||
.. c:type:: mps_ap_s
|
||||
|
||||
The type of the structure used to represent :term:`allocation
|
||||
points <allocation point>`::
|
||||
The type of the structure used to represent :term:`allocation
|
||||
points <allocation point>`::
|
||||
|
||||
typedef struct mps_ap_s {
|
||||
mps_addr_t init;
|
||||
mps_addr_t alloc;
|
||||
mps_addr_t limit;
|
||||
/* ... private fields ... */
|
||||
} mps_ap_s;
|
||||
typedef struct mps_ap_s {
|
||||
mps_addr_t init;
|
||||
mps_addr_t alloc;
|
||||
mps_addr_t limit;
|
||||
/* ... private fields ... */
|
||||
} mps_ap_s;
|
||||
|
||||
``init`` is the limit of initialized memory.
|
||||
``init`` is the limit of initialized memory.
|
||||
|
||||
``alloc`` is the limit of allocated memory.
|
||||
``alloc`` is the limit of allocated memory.
|
||||
|
||||
``limit`` is the limit of available memory.
|
||||
``limit`` is the limit of available memory.
|
||||
|
||||
An allocation point is an interface to a :term:`pool` which
|
||||
provides very fast allocation, and defers the need for
|
||||
|
|
@ -605,7 +604,7 @@ branch prediction should work well since the test almost never fails).
|
|||
.. note::
|
||||
|
||||
:c:func:`mps_ap_fill` must only be called according to the
|
||||
:term:`allocation point protocol`.
|
||||
:ref:`topic-allocation-point-protocol`.
|
||||
|
||||
|
||||
.. c:function:: mps_bool_t mps_ap_trip(mps_ap_t ap, mps_addr_t p, size_t size)
|
||||
|
|
@ -618,4 +617,4 @@ branch prediction should work well since the test almost never fails).
|
|||
.. note::
|
||||
|
||||
:c:func:`mps_ap_trip` must only be called according to the
|
||||
:term:`allocation point protocol`.
|
||||
:ref:`topic-allocation-point-protocol`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue