mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-24 15:22:26 -07:00
Add note that the mps does not throw or catch exceptions, as suggested by rb <https://info.ravenbrook.com/mail/2014/10/09/15-07-32/0/>. gloss "freestanding" and "hosted" to help explain why.
Copied from Perforce Change: 187169 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
f7f4e4a7f0
commit
e08c40c014
4 changed files with 59 additions and 18 deletions
|
|
@ -414,10 +414,34 @@ Memory Management Glossary: F
|
|||
|
||||
.. seealso:: :term:`free block`, :term:`free block chain`.
|
||||
|
||||
|
||||
freestanding
|
||||
|
||||
In the :term:`C` programming language as defined by
|
||||
:term:`C90`, a freestanding implementation "accepts any
|
||||
strictly conforming program in which the use of the features
|
||||
specified in the library section is confined to the contents
|
||||
of the standard headers ``<float.h>``, ``<limits.h>``,
|
||||
``<stdarg.h>``, and ``<stddef.h>``." The :term:`C99` standard
|
||||
adds ``<iso646.h>``, ``<stdbool.h>``, and ``<stdint.h>`` to
|
||||
this list.
|
||||
|
||||
In particular, a freestanding implementation need not provide
|
||||
the other features of the standard C library, including I/O,
|
||||
time, and string operations.
|
||||
|
||||
.. opposite:: :term:`hosted`.
|
||||
|
||||
.. mps:specific::
|
||||
|
||||
The MPS is designed to be portable to a freestanding
|
||||
implementation, by restricting the use of other features
|
||||
either to :term:`platform`\-specific modules or to the
|
||||
replaceable :term:`plinth` modules.
|
||||
|
||||
.. bibref:: :ref:`ISO/IEC 9899:1990 <C1990>`, :ref:`ISO/IEC 9899:1999 <C1999>`.
|
||||
|
||||
free store
|
||||
|
||||
.. see:: :term:`heap`.
|
||||
|
||||
freestore
|
||||
|
||||
.. see:: :term:`heap`.
|
||||
|
|
|
|||
|
|
@ -98,6 +98,16 @@ Memory Management Glossary: H
|
|||
|
||||
.. opposite:: :term:`miss rate`.
|
||||
|
||||
hosted
|
||||
|
||||
In the :term:`C` programming language, a hosted implementation
|
||||
is one that provides all the features of the standard C
|
||||
library.
|
||||
|
||||
.. opposite:: :term:`freestanding`.
|
||||
|
||||
.. bibref:: :ref:`ISO/IEC 9899:1990 <C1990>`, :ref:`ISO/IEC 9899:1999 <C1999>`.
|
||||
|
||||
hot
|
||||
|
||||
.. mps:specific::
|
||||
|
|
|
|||
|
|
@ -8,12 +8,18 @@ Error handing
|
|||
=============
|
||||
|
||||
Operations in the Memory Pool System that might fail return a
|
||||
:term:`result code` of type :c:type:`mps_res_t`, rather than a
|
||||
"special value" of the return type.
|
||||
:term:`result code` of type :c:type:`mps_res_t`. Success is always
|
||||
indicated by the result code :c:macro:`MPS_RES_OK`, which is defined
|
||||
to be zero. Other result codes indicate failure, and are non-zero. The
|
||||
MPS never uses a "special value" of some other type to indicate
|
||||
failure (such as returning ``NULL`` for a pointer result, or −1 for a
|
||||
size result).
|
||||
|
||||
Success is always indicated by the result code :c:macro:`MPS_RES_OK`,
|
||||
which is defined to be zero. Other result codes indicate failure, and
|
||||
are non-zero.
|
||||
.. note::
|
||||
|
||||
The MPS does not throw or catch exceptions. (This is necessary
|
||||
for the MPS to be portable to systems that have only a
|
||||
:term:`freestanding` implementation of the C language.)
|
||||
|
||||
The modular nature of the MPS means that it is not usually possible
|
||||
for a function description to list the possible error codes that it
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ The :dfn:`plinth` is a program module that provides the MPS with the
|
|||
support it needs from the execution environment. The MPS uses the plinth instead of (say) the Standard C Library because:
|
||||
|
||||
#. The MPS is designed to be portable to systems that have only a
|
||||
*conforming freestanding implementation* of the C language: that
|
||||
is, systems which potentially lack some of the facilities of the
|
||||
:term:`freestanding` implementation of the C language: that is,
|
||||
systems which potentially lack some of the facilities of the
|
||||
Standard C Library, such as standard I/O. The plinth provides a way
|
||||
to map MPS requirements to the facilities provided on the platform,
|
||||
whatever they are.
|
||||
|
|
@ -39,17 +39,18 @@ facilities is included with the MPS, and this is good enough for most
|
|||
applications.
|
||||
|
||||
There are many reasons why you might want to write your own plinth.
|
||||
You may be targeting a *freestanding environment* such as an embedded
|
||||
system. You might need to write the telemetry stream to a system
|
||||
logging facility, or transmit it over a serial port or network
|
||||
connection. Or you might need to direct debugging output to a
|
||||
convenient window in the user interface.
|
||||
You may be targeting an embedded system with only a
|
||||
:term:`freestanding` implementation of the C language. You might need
|
||||
to write the telemetry stream to a system logging facility, or
|
||||
transmit it over a serial port or network connection. Or you might
|
||||
need to direct debugging output to a convenient window in the user
|
||||
interface.
|
||||
|
||||
The plinth is divided into two parts:
|
||||
|
||||
#. The :ref:`topic-plinth-io` provides general-purpose I/O
|
||||
functionality. It is used by the :term:`telemetry` system to output
|
||||
a stream of events to assist with debugging and profiling.
|
||||
functionality. It is used to output a :term:`telemetry stream` of
|
||||
events to assist with debugging and profiling.
|
||||
|
||||
#. The :ref:`topic-plinth-lib` provides miscellaneous functionality
|
||||
that would be available via the Standard C Library on a hosted
|
||||
|
|
@ -254,7 +255,7 @@ Library module
|
|||
|
||||
In the ANSI Library module, ``mpsliban.c``, this reports the
|
||||
failure by calling ``fprintf(stderr, "...%s...", message)``,
|
||||
flushes the :term:`telemetry` stream by calling
|
||||
flushes the :term:`telemetry stream` by calling
|
||||
:c:func:`mps_telemetry_flush`, and, in the :term:`cool`
|
||||
:term:`variety`, terminates the program by calling
|
||||
:c:func:`abort`. You can change this behaviour with
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue