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.
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.
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.
This ensures that if a mutator thread is blocked in a system call when
the MPS handles a signal, the system call will not fail with EINTR but
instead will be restarted.
Add a test case for the thread suspend and resume signals.
We no longer need the -Wno-extended-offsetof or -Wno-invalid-offsetof
compiler options, since the nonstandard uses of offsetof() were
fixed (see job003619), so they can just be removed.
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
1. Being on the critical path is a property of the code location where the event is emitted, not of the event type, so indicate this using EVENT_CRITICAL macros rather than a field in the event table.
2. Compile out events on the critical path in hot varieties.
3. Remove TraceFixWhite event (redundant with TraceFixSeg).
4. No need for special handling of PoolFree event -- this are already skipped in hot varieties by dispatching directly to the pool class via PoolFreeMacro.
Copied from Perforce
Change: 195261
Split event ArenaAccess into ArenaAccessBegin and ArenaAccessEnd to avoid the need for the count field.
New events SegReclaim and SegScan.
Delete some redundant events: AMCFinish (PoolFinish), AMCFix, AMCFixForward, AMCFixInPlace (TraceFix), AMCGenCreate (GenInit), AMCGenDestroy (GenFinish), AMCInit (PoolInitAMC), AMCReclaim (SegReclaim), AMCScanBegin, AMCScanEnd (SegScan), ArenaWriteFaults (ArenaAccessBegin), PoolInitMV, TraceScanSeg (SegScan).
Add result code field to events ArenaAllocFail, CommitLimitSet, SegAllocFail.
Remove arena field from events PoolInitAMS, PoolInitMFS, PoolInitMVFF (already appeared in generic PoolInit event).
Copied from Perforce
Change: 195247