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

Catch-up merge from master sources to mps/branch/2016-03-15/sunrise.

Copied from Perforce
 Change: 190136
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Brooksby 2016-03-17 08:20:25 +00:00
commit ee194332cf
8 changed files with 30 additions and 11 deletions

View file

@ -36,7 +36,7 @@
*/
#define EVENT_VERSION_MAJOR ((unsigned)1)
#define EVENT_VERSION_MEDIAN ((unsigned)5)
#define EVENT_VERSION_MEDIAN ((unsigned)6)
#define EVENT_VERSION_MINOR ((unsigned)0)

View file

@ -140,6 +140,7 @@ Res FormatCreate(Format *formatReturn, Arena arena, ArgList args)
format->arena = arena;
RingInit(&format->arenaRing);
format->poolCount = 0;
format->alignment = fmtAlign;
format->headerSize = fmtHeaderSize;
format->scan = fmtScan;
@ -167,6 +168,7 @@ Res FormatCreate(Format *formatReturn, Arena arena, ArgList args)
void FormatDestroy(Format format)
{
AVERT(Format, format);
AVER(format->poolCount == 0);
RingRemove(&format->arenaRing);
@ -229,6 +231,7 @@ Res FormatDescribe(Format format, mps_lib_FILE *stream, Count depth)
"Format $P ($U) {\n", (WriteFP)format, (WriteFU)format->serial,
" arena $P ($U)\n",
(WriteFP)format->arena, (WriteFU)format->arena->serial,
" poolCount $U\n", (WriteFU)format->poolCount,
" alignment $W\n", (WriteFW)format->alignment,
" scan $F\n", (WriteFF)format->scan,
" skip $F\n", (WriteFF)format->skip,

View file

@ -374,6 +374,7 @@ typedef struct mps_fmt_s {
Serial serial; /* from arena->formatSerial */
Arena arena; /* owning arena */
RingStruct arenaRing; /* formats are attached to the arena */
Count poolCount; /* number of pools using the format */
Align alignment; /* alignment of formatted objects */
mps_fmt_scan_t scan;
mps_fmt_skip_t skip;

View file

@ -533,6 +533,8 @@ extern mps_res_t (mps_reserve)(mps_addr_t *, mps_ap_t, size_t);
extern mps_bool_t (mps_commit)(mps_ap_t, mps_addr_t, size_t);
extern mps_res_t mps_ap_fill(mps_addr_t *, mps_ap_t, size_t);
/* mps_ap_fill_with_reservoir_permit is deprecated */
extern mps_res_t mps_ap_fill_with_reservoir_permit(mps_addr_t *,
mps_ap_t,
size_t);

View file

@ -1175,7 +1175,7 @@ mps_res_t mps_sac_fill(mps_addr_t *p_o, mps_sac_t mps_sac, size_t size,
AVER(p_o != NULL);
AVER(TESTT(SAC, sac));
arena = SACArena(sac);
UNUSED(has_reservoir_permit); /* FIXME */
UNUSED(has_reservoir_permit); /* deprecated */
ArenaEnter(arena);

View file

@ -169,6 +169,11 @@ Res PoolInit(Pool pool, Arena arena, PoolClass class, ArgList args)
/* Add initialized pool to list of pools in arena. */
RingAppend(&globals->poolRing, &pool->arenaRing);
/* Add initialized pool to list of pools using format. */
if (pool->format) {
++ pool->format->poolCount;
}
return ResOK;
failInit:
@ -228,8 +233,12 @@ void PoolFinish(Pool pool)
/* Do any class-specific finishing. */
(*pool->class->finish)(pool);
/* Detach the pool from the arena, and unsig it. */
/* Detach the pool from the arena and format, and unsig it. */
RingRemove(&pool->arenaRing);
if (pool->format) {
AVER(pool->format->poolCount > 0);
-- pool->format->poolCount;
}
pool->sig = SigInvalid;
RingFinish(&pool->segRing);

View file

@ -306,14 +306,14 @@ takes the following options:
For example, here's the result of passing the output shown above
through :program:`mpseventtxt`::
000AE03973336E3C 002B VMCreate vm:00000001003FC000 base:00000001003FD000 limit:00000001003FE000
000AE0397333BC6D 002D VMMap vm:00000001003FC000 base:00000001003FD000 limit:00000001003FE000
000AE0397334DF9F 001A Intern stringId:0000000000000002 string:"Reservoir"
000AE0397334E0A0 001B Label address:00000001078C85B8["Reservoir"] stringId:0000000000000002
000AE03973352375 0015 PoolInit pool:00000001003FD328 arena:00000001003FD000 poolClass:00000001078C85B8["Reservoir"]
000AE039733592F9 002B VMCreate vm:00000001003FE000 base:00000001003FF000 limit:000000010992F000
000AE0397335C8B5 002D VMMap vm:00000001003FE000 base:00000001003FF000 limit:0000000107930000
000AE03973361D5A 0005 ArenaCreateVM arena:00000001003FD000 userSize:0000000002000000 chunkSize:0000000002000000
000021C9DB3812C7 0075 EventClockSync clock:0000000000001EE3
000021C9DB39E2FB 002B VMInit vm:00007FFF5429C4B8 base:000000010BA4A000 limit:000000010BA4B000
000021C9DB3A5630 002D VMMap vm:00007FFF5429C4B8 base:000000010BA4A000 limit:000000010BA4B000
000021C9DB3E6BAA 001A Intern stringId:0000000000000002 string:"MFS"
000021C9DB3E6E17 001B Label address:000000010BA0C5D8["MFS"] stringId:0000000000000002
000021C9DB3EB6F8 0044 PoolInitMFS pool:000000010BA4A360 arena:000000010BA4A000 extendBy:0000000000001000 extendSelf:False unitSize:0000000000000030
000021C9DB3EFE3B 002B VMInit vm:00007FFF5429C3D0 base:000000010BC84000 limit:000000010CC24000
000021C9DB3F33F3 002D VMMap vm:00007FFF5429C3D0 base:000000010BC84000 limit:000000010BC85000
.. index::

View file

@ -4,6 +4,10 @@ TEST_HEADER
summary = destroy a format though attached to a pool
language = c
link = testlib.o
OUTPUT_SPEC
assert = true
assertfile P= format.c
assertcond = format->poolCount == 0
END_HEADER
*/