1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 20:00:46 -08:00
Commit graph

339 commits

Author SHA1 Message Date
Gareth Rees
7bf58e3f53 Represent the spare memory as a land. 2022-01-17 20:19:07 +00:00
Gareth Rees
fe656c0565 New api function mps_pool_walk. 2022-01-17 17:39:18 +00:00
Gareth Rees
c37f35532d New function scanstateupdatesummary updates seg summary after scan. 2022-01-17 17:12:58 +00:00
Gareth Rees
0ee4d7ca06 Indirect formatted scanning through the scanstate.
This will allow us to reuse the scanning protocol with an arbitrary area
scanning function (replacing traceFormatScan) in order to implement
formatted object walking without an extra segment method.

Don't insist on scanning only grey segments: we want to be able to
reuse the scan protocol for walking, when the segments are black.
2022-01-17 17:12:58 +00:00
Gareth Rees
452b023a8f Improve maintainability of complex loops.
1. Avoid looping over two expressions in parallel when one makes more
   sense (compilers can do strength reduction optimization: we don't
   need to do it ourselves).

2. Introduce macro ITER_PARALLEL for iterating over two expressions in
   parallel, to clarify the intention and explain the need for the
   cast to void in the implementation.

3. Add macros SAC_LARGE_ITER and SAC_SMALL_ITER to reduce the amount
   of code duplication in sac.c.
2021-01-16 17:06:07 +00:00
Gareth Rees
45376b0353 Ensure that the mps builds with "clang -werror -wcomma -std=c89".
The -Wcomma option appears to be turned on automatically by Xcode
12.3, so it's a good idea for the MPS to build with the option, to
avoid unpleasant surprises when people update their Xcode.

The simplest way to suppress the warning is to cast the left hand side
of the comma operator to void.
2021-01-16 17:06:06 +00:00
Gareth Rees
76bff163f5 Ensure that the mps builds with clang 10.
Clang 10 turns on -Wimplicit-int-float-conversion, and on 64-bit
platforms this issues a warning that implicit conversions to double
from Size and unsigned long "may lose precision".

This commit adds casts to (double) for all such conversions. The loss
of precision is either impossible in practice (because a double can
represent all integers up to 2**53, which is about 9 petabytes, well
beyond the addressing capabilities for current CPUs), or else
acceptable, because we are accumulating an approximate quantity like
"collection work" or "fill size" (that has to cope with loss of
precision due in any case), or computing a threshold like the spare
commit limit where it is acceptable for it to be somewhat approximate.
2021-01-10 10:42:05 +00:00
Gareth Rees
1e77b9d762 Remove mps_fix, deprecated since release 1.111.0
Also remove undocumented and deprecated MPS_FIX macro, and rename
TRACE_FIX to TRACE_FIX12 to maintain parallelism.
2020-09-27 14:16:39 +01:00
Gareth Rees
93438da02d Remove mps_arena_expose, deprecated since release 1.111.0
Also remove mps_arena_unsafe_expose_remember_protection and
mps_arena_unsafe_expose_restore_protection.
2020-09-24 09:35:47 +01:00
Gareth Rees
5559f36540 Fix indentation of second clause of license. 2020-08-30 10:13:06 +01:00
Gareth Rees
5165d75267 Use https: instead of http: when linking to the ravenbrook web site. 2020-08-30 10:13:03 +01:00
Peter Jackson
1d00afac81 Publish licence updates in code directory.
Publish minor changes to readme and configure files in main directory.
Main directory and code directory licence texts are now fully updated.

Copied from Perforce
 Change: 196994
2020-06-11 17:05:40 +01:00
Gareth Rees
0b324c158b Use tags with dots; regularize design references from code.
Copied from Perforce
 Change: 195761
2018-11-29 17:12:29 +00:00
Gareth Rees
06b87869fd Catch-up merge from master sources at changelevel 194022 to branch/2018-06-20/monitor.
Copied from Perforce
 Change: 195071
2018-09-15 21:29:28 +01:00
Gareth Rees
d6c8713da4 Address issues found in review <https://info.ravenbrook.com/mail/2018/09/13/15-44-23/0/>
Copied from Perforce
 Change: 195057
2018-09-13 16:47:51 +01:00
Gareth Rees
b0d0c9a262 Merge branch/2018-08-01/land-insert-steal into the master sources.
Copied from Perforce
 Change: 194968
2018-08-13 14:42:25 +01:00
Gareth Rees
b89acd072b Address points 1-10, 13-14 from <https://info.ravenbrook.com/mail/2018/08/03/10-09-09/0/>
Copied from Perforce
 Change: 194942
2018-08-13 08:10:55 +01:00
Gareth Rees
3bfd0a545e Catch-up merge from master sources at changelevel 194869 to branch/2016-03-04/spare-fraction.
Copied from Perforce
 Change: 194872
2018-08-02 15:14:23 +01:00
Gareth Rees
9643a1f090 New land functions landinsertsteal and landdeletesteal and unit test.
Use LandInsertSteal instead of arenaFreeLandInsertSteal.
Add regression test for job004102.

Copied from Perforce
 Change: 194861
2018-08-02 13:16:15 +01:00
Gareth Rees
2448783b2d Merge branch/2018-07-09/seg-alloc into the master sources.
Copied from Perforce
 Change: 194690
2018-07-19 06:25:51 +01:00
Gareth Rees
c3fd9d5ba7 Represent the set of generations condemned for a trace.
Eliminate duplication between policyCondemnChain and traceCondemnAll.
Compute better mortality estimate for collection of the world.

Copied from Perforce
 Change: 194611
2018-07-11 21:14:43 +01:00
Gareth Rees
d2e619b743 New bufferfill and bufferempty methods on segments.
Copied from Perforce
 Change: 194568
2018-07-10 15:02:18 +01:00
Gareth Rees
3366ef1bc2 Catch-up merge from master sources at changelevel 194449 to branch/2018-06-18/mrgseg.
Copied from Perforce
 Change: 194452
2018-07-05 16:22:24 +01:00
Gareth Rees
2b469ef694 Merge branch/2018-07-04/mvff-perf into the master sources.
Copied from Perforce
 Change: 194439
2018-07-05 12:54:16 +01:00
Gareth Rees
01ee85b290 No need for rvalue(&(...)) -- the result of the & operator is not an lvalue.
Copied from Perforce
 Change: 194424
2018-07-05 10:24:22 +01:00
Gareth Rees
5887f80601 Function implementations call the macro implementations, to reduce the burden of keeping the functions and macros consistent.
Copied from Perforce
 Change: 194418
2018-07-05 09:28:01 +01:00
Gareth Rees
683c79008c Improve performance of mvff in hot builds by:
1. Using macros to bypass PoolFree and Land* generic functions.
2. Compiling out assertions on functions on the critical paths for manual allocation and freeing.
3. Taking advantage of the fact that splay->updateNode does not change during a splay operation.

Copied from Perforce
 Change: 194397
2018-07-04 14:30:22 +01:00
Gareth Rees
a5ddfca39b New generic function segflip allows the segment to decide how to handle a trace that’s about to flip.
Copied from Perforce
 Change: 194000
2018-06-20 10:23:16 +01:00
Gareth Rees
e93949aeef Refactor arenapeekseg so that it maintains the mps invariants by scanning the segment if necessary. arenaread is now a thin wrapper around arenapeekseg. new function arenawrite is now the corresponding wrapper around arenapokeseg.
MRG reference segments inherit from GCSeg (not MutatorSeg) and so don't have hardware barriers. Instead, the code implements software barriers by always using ArenaRead and ArenaWrite.

Copied from Perforce
 Change: 193990
2018-06-19 16:25:52 +01:00
Gareth Rees
7f7822d4ab Segment class gcseg no longer implements hardware barriers; these are implemented by new subclass mutatorseg, which is now used everywhere that gcseg was used formerly. the idea is that in a future change mrgrefseg will inherit from gcseg instead of mutatorseg.
Copied from Perforce
 Change: 193981
2018-06-19 14:45:42 +01:00
Gareth Rees
5324b1a2dd Catch-up merge from master sources at change 193831 to branch/2017-03-04/seg-methods.
Copied from Perforce
 Change: 193836
2018-06-15 13:46:23 +01:00
Gareth Rees
61e24c399a Take locks before fork(), release them in the parent and reinitialize them in the child.
Add forktest target to the Xcode project.
Write design for fork safety and cross-reference from the code.
Update release notes.

Copied from Perforce
 Change: 193760
2018-06-14 16:25:08 +01:00
Gareth Rees
2ccdd80953 Extend forktest so that it does allocation before the fork and collection afterwards; this ensures that we hit the read barrier and thus exercise the exception handling.
After forking in the child, re-create exception port and exception thread, and re-register the (only) thread with that port.

Copied from Perforce
 Change: 193755
2018-06-14 12:54:35 +01:00
Gareth Rees
47fc093662 Add fork test case (fails on os x if pthread_atfork is not called).
pthread_atfork handlers on OS X: in the child, update the mach port for the forking thread and move all other threads to the dead ring.

Copied from Perforce
 Change: 193746
2018-06-13 17:09:07 +01:00
Gareth Rees
2b3fbbb8d3 New pool method poolsegpoolgen gets the pool generation for a segment. (this allows the segment whiten and reclaim methods not to need to know the pool class.)
Copied from Perforce
 Change: 193084
 ServerID: perforce.ravenbrook.com
2017-03-31 13:28:25 +01:00
Gareth Rees
d8a5c865ba Since we know that a segment belongs to a pool with a format at the point where we call segwalk, it makes sense to pass the format.
Copied from Perforce
 Change: 193079
 ServerID: perforce.ravenbrook.com
2017-03-31 09:15:41 +01:00
Gareth Rees
178c269987 Move alignshift to pool structure allows us to eliminate duplicate code between awl and lo.
Copied from Perforce
 Change: 193071
 ServerID: perforce.ravenbrook.com
2017-03-31 08:41:14 +01:00
Gareth Rees
dd1b5b2f27 No need for poolclassmixinscan and abstractscanpool.
Copied from Perforce
 Change: 193045
 ServerID: perforce.ravenbrook.com
2017-03-30 10:23:15 +01:00
Gareth Rees
b295670a76 Changing segnowalk to segtrivwalk avoids the need for attrfmt (now we can walk all segments).
Copied from Perforce
 Change: 193044
 ServerID: perforce.ravenbrook.com
2017-03-30 10:18:22 +01:00
Gareth Rees
4c9f14729f Move access method from pool class to segment class.
Copied from Perforce
 Change: 193039
 ServerID: perforce.ravenbrook.com
2017-03-30 09:55:37 +01:00
Gareth Rees
109dabad27 Move walk method from pool class to segment class.
Copied from Perforce
 Change: 193028
 ServerID: perforce.ravenbrook.com
2017-03-30 08:54:35 +01:00
Gareth Rees
45e05c62cd Move fix and fixemergency methods from pool class to segment class.
Copied from Perforce
 Change: 193023
 ServerID: perforce.ravenbrook.com
2017-03-30 08:09:14 +01:00
Gareth Rees
1cb3265e80 Move scan method from pool class to segment class.
Copied from Perforce
 Change: 193012
 ServerID: perforce.ravenbrook.com
2017-03-29 19:17:17 +01:00
Gareth Rees
de269de563 Move reclaim method from pool class to segment class.
Copied from Perforce
 Change: 193007
 ServerID: perforce.ravenbrook.com
2017-03-29 17:13:45 +01:00
Gareth Rees
bfe43c367e Move whiten method from pool class to segment class.
Copied from Perforce
 Change: 193002
 ServerID: perforce.ravenbrook.com
2017-03-29 16:22:14 +01:00
Gareth Rees
826b74a030 Move greyen method from pool class to segment class.
Copied from Perforce
 Change: 192997
 ServerID: perforce.ravenbrook.com
2017-03-29 15:58:32 +01:00
Gareth Rees
6dabd6de2b Move the blacken method from the pool class to the segment class.
Copied from Perforce
 Change: 192994
 ServerID: perforce.ravenbrook.com
2017-03-29 15:32:17 +01:00
Gareth Rees
577b32d481 Cherry-pick change 192595 from custom/cet/main, removing mps_addr_object. this function failed to solve the problem of decoding the stack on 64-bit windows, because the stack may need to be decoded after an mps assertion failure, in which case the arena lock is held and mps_addr_object cannot be called. we eventually solved the problem in a different way (using mps_arena_postmortem) and mps_addr_object is no longer used.
Copied from Perforce
 Change: 192637
 ServerID: perforce.ravenbrook.com
2016-10-19 14:13:38 +01:00
Gareth Rees
9f505c501d Remove unused pool class methods tracebegin and traceend.
Remove unused event AMCTraceEnd.
The fixEmergency method must have the same type as the fix method because of how they are used.

Copied from Perforce
 Change: 192636
 ServerID: perforce.ravenbrook.com
2016-10-19 14:07:20 +01:00
Gareth Rees
52d40d2fed Remove unused functions landcreate and landdestroy.
Copied from Perforce
 Change: 192603
 ServerID: perforce.ravenbrook.com
2016-10-14 22:30:11 +01:00