1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 22:40:51 -08:00
Commit graph

78 commits

Author SHA1 Message Date
Richard Brooksby
07987ab579 Eliminating withreservoirpermit and all its variants.
Copied from Perforce
 Change: 190005
 ServerID: perforce.ravenbrook.com
2016-03-13 21:04:01 +00:00
Gareth Rees
c56dd90bbb Merge poolamsi.c into poolams.c for consistency with other pool class implementations.
Copied from Perforce
 Change: 189681
 ServerID: perforce.ravenbrook.com
2016-03-06 18:49:47 +00:00
Richard Brooksby
8a4e5ab290 Moving scanning accounting to tracescanarea and creating analogous formatscan.
Copied from Perforce
 Change: 189325
 ServerID: perforce.ravenbrook.com
2016-02-19 12:11:50 +00:00
Gareth Rees
d4b8907389 Assert if you try to create a pool using a format from another arena, a pool using a chain from another arena, or a root using a thread from another arena.
Copied from Perforce
 Change: 187268
 ServerID: perforce.ravenbrook.com
2014-10-14 22:21:43 +01:00
Gareth Rees
0c42e3aa23 Improved assertion messages when a required keyword argument is not found. instead of "unreachable code", the assertion message is the name of the missing key.
Copied from Perforce
 Change: 187267
 ServerID: perforce.ravenbrook.com
2014-10-14 22:05:30 +01:00
Gareth Rees
00229b0479 Use the method suffix only for methods in classes; use visitor or function for other kinds of functions.
New document guide.impl.c.naming sets out the rules for naming.

Copied from Perforce
 Change: 187159
 ServerID: perforce.ravenbrook.com
2014-10-07 23:48:55 +01:00
Gareth Rees
c968255f1e Ensure that code of the form if (condition) statement; is split over two lines, so that it is possible to set a breakpoint on the statement in a debugger.
This change was agreed in 1997 (see <https://info.ravenbrook.com/project/mps/mail/1997/08/19/13-44/0.txt>), so it's about time it was implemented.

Copied from Perforce
 Change: 187071
 ServerID: perforce.ravenbrook.com
2014-09-27 22:57:02 +01:00
Gareth Rees
1f517274f3 Cast all arguments to the writef function to make it easy to check that none of the necessary casts have been omitted.
New macro WriteFYesNo makes it easy to describe a Boolean.
Describe more structure elements for ABQ, Arena, Buffer, Format, MFS, Root, Seg.

Copied from Perforce
 Change: 187063
 ServerID: perforce.ravenbrook.com
2014-09-27 12:49:30 +01:00
Gareth Rees
a13a1aa1df Catch-up merge from master sources @186564 to branch/2014-06-11/grain.
Copied from Perforce
 Change: 186572
 ServerID: perforce.ravenbrook.com
2014-06-13 15:30:46 +01:00
Gareth Rees
5e11b7034a Catch-up merge from master sources @186536 to branch/2014-05-15/size.
Copied from Perforce
 Change: 186539
 ServerID: perforce.ravenbrook.com
2014-06-12 16:46:36 +01:00
Gareth Rees
9268a0adc8 Catch-up merge from master sources @186528 to branch/2014-04-15/mvffnoseg.
Copied from Perforce
 Change: 186534
 ServerID: perforce.ravenbrook.com
2014-06-12 15:59:39 +01:00
Gareth Rees
15df9bb6de Use xyzpool macros systematically as suggested by nb in <https://info.ravenbrook.com/mail/2014/06/11/20-47-37/0/>
Copied from Perforce
 Change: 186529
 ServerID: perforce.ravenbrook.com
2014-06-12 14:25:00 +01:00
Gareth Rees
cb629746ea Catch-up merge from masters sources @186519 to branch/2014-04-17/describe.
Copied from Perforce
 Change: 186526
 ServerID: perforce.ravenbrook.com
2014-06-12 13:45:22 +01:00
Gareth Rees
b0470a6298 Some remaining occurrences of "arena alignment".
Copied from Perforce
 Change: 186513
 ServerID: perforce.ravenbrook.com
2014-06-11 22:22:02 +01:00
Gareth Rees
bfb0b771dd Rename "arena alignment" to "arena grain size" to avoid confusion with ordinary structure alignment.
Copied from Perforce
 Change: 186503
 ServerID: perforce.ravenbrook.com
2014-06-11 17:13:03 +01:00
Gareth Rees
5969ae2114 Catch-up merge from branch/2014-04-15/mvffnoseg @186485 to branch/2014-05-15/size.
Copied from Perforce
 Change: 186487
 ServerID: perforce.ravenbrook.com
2014-06-11 13:17:14 +01:00
Gareth Rees
03f8b41b44 Encapsulate the artifical ageing and reclaiming that's need to ensure that all the memory in a segment is accounted as free. addresses point made by rb in <https://info.ravenbrook.com/mail/2014/06/02/15-43-00/0/>
Copied from Perforce
 Change: 186428
 ServerID: perforce.ravenbrook.com
2014-06-08 13:12:12 +01:00
Gareth Rees
f37b0868c0 Rename poolgen functions to make it clear that they only handle accounting.
Copied from Perforce
 Change: 186368
 ServerID: perforce.ravenbrook.com
2014-05-30 12:29:42 +01:00
Gareth Rees
981a266642 New public functions mps_pool_total_size and mps_pool_free_size.
Old (undocumented) functions mps_{mv,mvff,mvt}_size and mps_{mv,mvff,mvt}_free_size are now macros for the new public functions.
New pool methods PoolTotalSize and PoolFreeSize, with implementations for public pool classes except SNC.
Coverage of the new functions in apss and mpmss for the manual pool classes, and in finaltest for the automatic pool classes.

Copied from Perforce
 Change: 186118
 ServerID: perforce.ravenbrook.com
2014-05-15 17:01:59 +01:00
Gareth Rees
4d10bb418b Catch-up merge from master sources @186077 to branch/2014-04-23/awl.
Copied from Perforce
 Change: 186110
 ServerID: perforce.ravenbrook.com
2014-05-15 10:17:41 +01:00
Gareth Rees
30f37732a9 Catch-up merge from master sources @185999 to branch/2014-04-17/describe.
Copied from Perforce
 Change: 186003
 ServerID: perforce.ravenbrook.com
2014-05-11 18:33:02 +01:00
Gareth Rees
c77c91056d Consistent order stream, depth.
Copied from Perforce
 Change: 186001
 ServerID: perforce.ravenbrook.com
2014-05-11 18:30:23 +01:00
Gareth Rees
2493f121dc Correct indentation of describe output by passing depth parameter to describe functions and to writef.
Call Describe functions from test cases so that we get coverage.

Copied from Perforce
 Change: 186000
 ServerID: perforce.ravenbrook.com
2014-05-11 18:20:38 +01:00
Gareth Rees
be87b190ed Defined(aver_and_check_all) is a better condition for invalidating the colour tables.
Copied from Perforce
 Change: 185993
 ServerID: perforce.ravenbrook.com
2014-05-10 09:45:26 +01:00
Gareth Rees
d1b44a4f05 Back out change 185626 (violates the design.mps.writef.snazzy).
Copied from Perforce
 Change: 185941
 ServerID: perforce.ravenbrook.com
2014-05-02 12:44:31 +01:00
Gareth Rees
32416cc272 Better names for poolgen functions.
Accounting for segment splitting and merging.
Accounting for allocation and freeing in segsmss.

Copied from Perforce
 Change: 185894
 ServerID: perforce.ravenbrook.com
2014-04-30 13:49:26 +01:00
Gareth Rees
82db47ceac Undo seghasbuffer change, to simplify the diffs.
Copied from Perforce
 Change: 185890
 ServerID: perforce.ravenbrook.com
2014-04-30 12:56:30 +01:00
Gareth Rees
36d731c149 Use double-entry book-keeping and bank reconciliation to ensure the soundness and completeness of the pool generation size accounting.
Copied from Perforce
 Change: 185888
 ServerID: perforce.ravenbrook.com
2014-04-30 12:14:54 +01:00
Gareth Rees
0eb9ac546f Pool generations now refer directly to their generation (not via a chain and a generation number).
Allocation into a generation now via PoolGenAlloc (not ChainAlloc).
The "top generation" logic is encapsulated in the function ChainGen.

Copied from Perforce
 Change: 185877
 ServerID: perforce.ravenbrook.com
2014-04-30 11:18:44 +01:00
Gareth Rees
6721c2b913 Correct indentation of describe output.
Copied from Perforce
 Change: 185626
 ServerID: perforce.ravenbrook.com
2014-04-17 13:36:42 +01:00
Gareth Rees
5eebc02a46 Explain reasoning in amsbufferempty, as requested by rb <https://info.ravenbrook.com/mail/2014/04/16/12-42-33/0/>.
Copied from Perforce
 Change: 185603
 ServerID: perforce.ravenbrook.com
2014-04-16 13:59:33 +01:00
Gareth Rees
e97db74a0c Avoid avers with side effects, as requested by rb in <https://info.ravenbrook.com/mail/2014/04/16/11-47-22/0/>
Copied from Perforce
 Change: 185595
 ServerID: perforce.ravenbrook.com
2014-04-16 13:23:56 +01:00
Gareth Rees
c6c46536c2 Must ensure the consistency of a segment even if we are just about to free it, because the segment must pass the segcheck inside segfree.
Copied from Perforce
 Change: 185440
 ServerID: perforce.ravenbrook.com
2014-04-10 19:40:42 +01:00
Gareth Rees
4e30c7d2b8 Don't turn on the alloctable in amsbufferempty when it's shared with nonwhitetable and the colour tables are in use -- this will turn any grey grains in the segment invalid.
Add more checking to AMS, including the table use invariant.

Copied from Perforce
 Change: 185434
 ServerID: perforce.ravenbrook.com
2014-04-10 18:16:29 +01:00
Gareth Rees
d3d2795fce Improve control over checking:
1. Where Type is a pointer type with a signature, replace CHECKL(TypeCheck(val)) with CHECKD(Type, val).
2. Where Type is a pointer type with no signature, replace CHECKL(TypeCheck(val)) with CHECKD_NOSIG(Type, val).
3. Where Type is a pointer type with a signature, but the structure is not visible at point of checking, replace CHECKL(TypeCheck(val)) with CHECKD_NOSIG(Type, val). Reference <design/check/#.hidden-type>
4. Make BTCheck extern and use it where possible.
5. Replace AVER(TypeCheck(val)) with AVERT(Type, val).

Copied from Perforce
 Change: 185263
 ServerID: perforce.ravenbrook.com
2014-04-06 22:51:05 +01:00
Gareth Rees
9bb6b2f8be Tidy-up of attributes and pool classes:
* Bring design up to date.
* New function PoolHasAttr encapsulates attribute checking.
* Abstract classes are abstract and mustn't be checked.
* The dummy pool class in fotest needs a size.
* Abstract pool classes null out methods that they can't provide a generic implementation for, to force subclasses to provide one.
* New function PoolTrivFramePopPending provides a generic implementation of that method.
* Rename PoolNoFreeWalk to PoolTrivFreeWalk since it has NOOP rather than NOTREACHED.
* Check that AttrMOVINGGC implies AttrGC.
* Remove unimplemented attributes (BUF_RESERVE, BUF_ALLOC, INCR_RB, INCR_WB, PM)
* AMC now inherits from AMCZ instead of the other way round. This is simpler: AMC adds features to AMCZ rather than AMCZ taking features away (and not quite getting it right).
* Similarly, LO inherits from AbstractSegBufPoolClass + PoolClassMixInCollect so that it doesn't have to clear AttrSCAN and the scan methods.
* Fix bug in MFSCheck -- mustn't check unroundedUnitSize >= UNIT_MIN since small unit sizes are rounded up to UNIT_MIN.
* Don't see AttrFREE in MRG (since no free method is supplied).
* Check AttrSCAN systematically (in PoolScan and SegCheck) rather than opportunistically in TraceStart and TraceQuantum.

Copied from Perforce
 Change: 185231
 ServerID: perforce.ravenbrook.com
2014-04-04 17:05:08 +01:00
Gareth Rees
673eea41a0 Check classes after defining them.
Copied from Perforce
 Change: 185228
 ServerID: perforce.ravenbrook.com
2014-04-04 12:51:07 +01:00
Richard Brooksby
2151d00c7f Catch-up merge from master, mainly to pick up spare-ring merge.
Copied from Perforce
 Change: 184365
 ServerID: perforce.ravenbrook.com
2014-02-18 13:47:49 +00:00
Richard Brooksby
2b0f94df6c Responding to review comments. see <https://info.ravenbrook.com/mail/2014/02/14/14-38-07/0/>.
Copied from Perforce
 Change: 184340
 ServerID: perforce.ravenbrook.com
2014-02-14 15:05:18 +00:00
Richard Brooksby
d3978def6a Removing unused segpref from ams.
Copied from Perforce
 Change: 184278
 ServerID: perforce.ravenbrook.com
2014-01-30 17:53:17 +00:00
Richard Brooksby
4b50f3688b Adding mps_key_gen generation keyword to pools that take a chain (except amc), so that you can specify which generation to allocate in by default. this allows some flexibility when the client can predict the lifetimes of objects.
The AWL and LO pools allocate into generation 1 of the arena default chain if neither MPS_KEY_CHAIN or MPS_KEY_GEN is specified, simulating the default setup before the chain-zones branch.

Copied from Perforce
 Change: 184231
 ServerID: perforce.ravenbrook.com
2014-01-30 14:27:09 +00:00
Richard Brooksby
17b69133b5 The ams pool no longer requires a chain argument, but defaults to the arena default chain.
Chains passed to the AMS pool are no longer required to contain a single generation, though the AMS will only use the first generation by default.

Copied from Perforce
 Change: 184229
 ServerID: perforce.ravenbrook.com
2014-01-30 13:21:45 +00:00
Richard Brooksby
8e4e0f066e Eliminating dodgy use of *segprefdefault() which could lead to implicit calls to memcpy.
Copied from Perforce
 Change: 184217
 ServerID: perforce.ravenbrook.com
2014-01-29 15:13:22 +00:00
Richard Brooksby
f1abe0e30f Abolishing the redundant generation to zone map in the vm arena, and replacing it with chainalloc, which allocates segments within a generation.
Generations from different chains will no longer share the same zone sets, and will not be collected together.  To get this behaviour, use the same chain, as documented.

Copied from Perforce
 Change: 184213
 ServerID: perforce.ravenbrook.com
2014-01-29 12:54:05 +00:00
Gareth Rees
692489dd2b Make keyword mps_key_ams_support_ambiguous optional, with default value false. update documentation accordingly.
Copied from Perforce
 Change: 183513
 ServerID: perforce.ravenbrook.com
2013-10-02 15:14:57 +01:00
Richard Brooksby
bb02f55b62 Making clear the size of the array of args passed to varargs conversion methods.
Copied from Perforce
 Change: 181845
 ServerID: perforce.ravenbrook.com
2013-05-16 03:12:11 +01:00
Richard Brooksby
93fee75c50 Eliminating unnecessary use of varargs in segment split and merge functions.
Copied from Perforce
 Change: 181842
 ServerID: perforce.ravenbrook.com
2013-05-16 03:02:20 +01:00
Richard Brooksby
af44d1241f Replacing varargs passed to seginit with keyword argument list.
Copied from Perforce
 Change: 181679
 ServerID: perforce.ravenbrook.com
2013-05-09 17:34:01 +01:00
Richard Brooksby
f4416c7efc Changing required keyword arguments to cause an assertion rather than return a status code, and removing repetition in how this is expressed.
Copied from Perforce
 Change: 181674
 ServerID: perforce.ravenbrook.com
2013-05-09 15:15:40 +01:00
Richard Brooksby
03c7de38b6 Macroizing keyword definitions and adding more keyword argument checking methods.
Copied from Perforce
 Change: 181647
 ServerID: perforce.ravenbrook.com
2013-05-08 23:40:40 +01:00