1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-07 20:30:32 -08:00

Remove the mv compatibility shim and update the manual.

Copied from Perforce
 Change: 194844
This commit is contained in:
Gareth Rees 2018-08-01 13:26:33 +01:00
parent 4e8de8d42e
commit faaa5287b7
4 changed files with 20 additions and 265 deletions

View file

@ -1,62 +0,0 @@
/* mpscmv.h: MEMORY POOL SYSTEM CLASS "MV"
*
* $Id$
* Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license.
*
* DEPRECATED: Suggested replacement is MVFF, but see the MPS manual.
*/
#ifndef mpscmv_h
#define mpscmv_h
#include "mps.h"
#define mps_mv_free_size mps_pool_free_size
#define mps_mv_size mps_pool_total_size
extern mps_pool_class_t mps_class_mv(void);
extern mps_pool_class_t mps_class_mv_debug(void);
#endif /* mpscmv_h */
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2014 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Redistributions in any form must be accompanied by information on how
* to obtain complete source code for this software and any accompanying
* software that uses this software. The source code must either be
* included in the distribution or be available for no more than the cost
* of distribution plus a nominal fee, and must be freely redistributable
* under reasonable conditions. For an executable file, complete source
* code means the source code for all modules it contains. It does not
* include source code for modules or files that typically accompany the
* major components of the operating system on which the executable file
* runs.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

View file

@ -757,81 +757,6 @@ Bool MVFFCheck(MVFF mvff)
}
/* Replacement of the deprecated MV pool class.
*
* MVFF replaces MV, but these functions are provided for backward
* compatibility. TODO: Remove these sometime after MPS 1.117.
*/
DECLARE_CLASS(Pool, MVPool, MVFFPool);
DECLARE_CLASS(Pool, MVDebugPool, MVPool);
static Res mvInit(Pool pool, Arena arena, PoolClass klass, ArgList args)
{
Index i;
AVER(pool != NULL);
AVERT(Arena, arena);
AVERC(PoolClass, klass);
AVERT(ArgList, args);
/* MV allows arbitrary alignment but MVFF does not, so round up. */
for (i = 0; args[i].key != MPS_KEY_ARGS_END; ++i)
if (args[i].key == MPS_KEY_ALIGN
&& args[i].val.align < FreelistMinimumAlignment)
args[i].val.align = FreelistMinimumAlignment;
return NextMethod(Pool, MVPool, init)(pool, arena, klass, args);
}
static void mvVarargs(ArgStruct args[MPS_ARGS_MAX], va_list varargs)
{
args[0].key = MPS_KEY_EXTEND_BY;
args[0].val.size = va_arg(varargs, Size);
args[1].key = MPS_KEY_MEAN_SIZE;
args[1].val.size = va_arg(varargs, Size);
args[2].key = MPS_KEY_MAX_SIZE;
args[2].val.size = va_arg(varargs, Size);
args[3].key = MPS_KEY_ARGS_END;
AVERT(ArgList, args);
}
static void mvDebugVarargs(ArgStruct args[MPS_ARGS_MAX], va_list varargs)
{
args[0].key = MPS_KEY_POOL_DEBUG_OPTIONS;
args[0].val.pool_debug_options = va_arg(varargs, mps_pool_debug_option_s *);
mvVarargs(args + 1, varargs);
}
DEFINE_CLASS(Pool, MVPool, klass)
{
INHERIT_CLASS(klass, MVPool, MVFFPool);
klass->init = mvInit;
klass->varargs = mvVarargs;
AVERT(PoolClass, klass);
}
DEFINE_CLASS(Pool, MVDebugPool, klass)
{
INHERIT_CLASS(klass, MVDebugPool, MVPool);
PoolClassMixInDebug(klass);
klass->size = sizeof(MVFFDebugStruct);
klass->varargs = mvDebugVarargs;
klass->debugMixin = MVFFDebugMixin;
AVERT(PoolClass, klass);
}
mps_pool_class_t mps_class_mv(void)
{
return CLASS(MVPool);
}
mps_pool_class_t mps_class_mv_debug(void)
{
return CLASS(MVDebugPool);
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2016 Ravenbrook Limited <http://www.ravenbrook.com/>.

View file

@ -4,6 +4,21 @@ Release notes
=============
.. _release-notes-1.118:
Release 1.118.0
---------------
Interface changes
.................
#. The deprecated pool class MV (Manual Variable), and the deprecated
functions ``mps_mv_free_size`` and ``mps_mv_size`` have been
removed. Use :ref:`pool-mvff` and the generic functions
:c:func:`mps_pool_free_size` and :c:func:`mps_pool_total_size`
instead.
.. _release-notes-1.117:
Release 1.117.0
@ -223,7 +238,7 @@ Interface changes
name :c:type:`mps_class_t` is still available via a ``typedef``,
but is deprecated.
#. The functions :c:func:`mps_mv_free_size`, :c:func:`mps_mv_size`,
#. The functions ``mps_mv_free_size``, ``mps_mv_size``,
:c:func:`mps_mvff_free_size`, :c:func:`mps_mvff_size`,
:c:func:`mps_mvt_free_size` and :c:func:`mps_mvt_size` are now
deprecated in favour of the generic functions

View file

@ -7,10 +7,10 @@ Deprecated interfaces
=====================
This chapter documents the public symbols in the MPS interface that
are now deprecated. These symbols may be removed in any future release
(see :ref:`topic-interface-support` for details). If you are using one
of these symbols, then you should update your code to use the
supported interface.
are currently deprecated. These symbols may be removed in any future
release (see :ref:`topic-interface-support` for details). If you are
using one of these symbols, then you should update your code to use
the supported interface.
.. note::
@ -19,77 +19,6 @@ supported interface.
makes a difference if we know that someone is using a feature.
.. index::
single: deprecated interfaces; in version 1.117
Deprecated in version 1.117
...........................
.. c:function:: mps_pool_class_t mps_class_mv(void)
.. deprecated::
Use :c:func:`mps_class_mvff` instead.
Return the :term:`pool class` for an MV (Manual Variable)
:term:`pool`.
When creating an MV pool, :c:func:`mps_pool_create_k` takes four
optional :term:`keyword arguments`:
* :c:macro:`MPS_KEY_ALIGN` (type :c:type:`mps_align_t`, default is
:c:macro:`MPS_PF_ALIGN`) is the :term:`alignment` of the
addresses allocated (and freed) in the pool. The minimum
alignment supported by pools of this class is 1 (one)
and the maximum is the arena grain size
(see :c:macro:`MPS_KEY_ARENA_GRAIN_SIZE`).
* :c:macro:`MPS_KEY_EXTEND_BY` (type :c:type:`size_t`,
default 65536) is the :term:`size` of block that the pool will
request from the :term:`arena`.
* :c:macro:`MPS_KEY_MEAN_SIZE` (type :c:type:`size_t`, default 32)
is the predicted mean size of blocks that will be allocated from
the pool. This value must be smaller than, or equal to, the
value for :c:macro:`MPS_KEY_EXTEND_BY`.
* :c:macro:`MPS_KEY_MAX_SIZE` (type :c:type:`size_t`,
default 65536) is the predicted maximum size of blocks that will
be allocated from the pool. This value must be larger than, or
equal to, the value for :c:macro:`MPS_KEY_EXTEND_BY`.
The mean and maximum sizes are *hints* to the MPS: the pool will be
less efficient if these are wrong, but nothing will break.
For example::
MPS_ARGS_BEGIN(args) {
MPS_ARGS_ADD(args, MPS_KEY_MEAN_SIZE, 32);
MPS_ARGS_ADD(args, MPS_KEY_MAX_SIZE, 1024);
MPS_ARGS_ADD(args, MPS_KEY_EXTEND_BY, 1024 * 1024);
res = mps_pool_create_k(&pool, arena, mps_class_mfs(), args);
} MPS_ARGS_END(args);
.. c:function:: mps_pool_class_t mps_class_mv_debug(void)
.. deprecated::
Use :c:func:`mps_class_mvff_debug` instead.
A :ref:`debugging <topic-debugging>` version of the MV pool
class.
When creating a debugging MV pool, :c:func:`mps_pool_create_k`
takes five optional keyword arguments: :c:macro:`MPS_KEY_ALIGN`,
:c:macro:`MPS_KEY_EXTEND_SIZE`, :c:macro:`MPS_KEY_MEAN_SIZE`,
:c:macro:`MPS_KEY_MAX_SIZE` are as described above, and
:c:macro:`MPS_KEY_POOL_DEBUG_OPTIONS` specifies the debugging
options. See :c:type:`mps_pool_debug_option_s`.
.. index::
single: deprecated interfaces; in version 1.115
@ -113,34 +42,6 @@ Deprecated in version 1.115
pools were the only objects in the MPS that belonged to
classes.
.. c:function:: size_t mps_mv_free_size(mps_pool_t pool)
.. deprecated::
Use the generic function :c:func:`mps_pool_free_size` instead.
Return the total amount of free space in an MV pool.
``pool`` is the MV pool.
Returns the total free space in the pool, in :term:`bytes (1)`.
.. c:function:: size_t mps_mv_size(mps_pool_t pool)
.. deprecated::
Use the generic function :c:func:`mps_pool_total_size`
instead.
Return the total size of an MV pool.
``pool`` is the MV pool.
Returns the total size of the pool, in :term:`bytes (1)`. This
is the sum of allocated space and free space.
.. c:function:: size_t mps_mvff_free_size(mps_pool_t pool)
@ -591,30 +492,6 @@ Deprecated in version 1.112
size_t extend_by,
size_t unit_size)
When creating a pool of class :c:func:`mps_class_mv`, pass the
values for the keyword arguments :c:macro:`MPS_KEY_EXTEND_BY`,
:c:macro:`MPS_KEY_MEAN_SIZE`, and :c:macro:`MPS_KEY_MAX_SIZE` like
this::
mps_res_t mps_pool_create(mps_pool_t *pool_o, mps_arena_t arena,
mps_pool_class_t mps_class_mv(),
size_t extend_by,
size_t mean_size,
size_t max_size)
When creating a pool of class :c:func:`mps_class_mv_debug`, pass
the values for the keyword arguments
:c:macro:`MPS_KEY_POOL_DEBUG_OPTIONS`,
:c:macro:`MPS_KEY_EXTEND_BY`, :c:macro:`MPS_KEY_MEAN_SIZE` and
:c:macro:`MPS_KEY_MAX_SIZE` like this::
mps_res_t mps_pool_create(mps_pool_t *pool_o, mps_arena_t arena,
mps_pool_class_t mps_class_mv_debug(),
mps_pool_debug_option_s *pool_debug_options,
size_t extend_by,
size_t mean_size,
size_t max_size)
When creating a pool of class :c:func:`mps_class_mvff`, pass the
values for the keyword arguments :c:macro:`MPS_KEY_EXTEND_BY`,
:c:macro:`MPS_KEY_MEAN_SIZE`, :c:macro:`MPS_KEY_ALIGN`,