Gareth Rees
b0d20ed749
Catch-up merge from master sources @186540 to branch/2014-05-17/chunk-tree.
...
Copied from Perforce
Change: 186546
ServerID: perforce.ravenbrook.com
2014-06-12 17:55:16 +01:00
Gareth Rees
c71e35f3c1
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
c2c38dedcc
Catch-up merge from master sources @186481 to branch/2014-05-17/chunk-tree.
...
Copied from Perforce
Change: 186491
ServerID: perforce.ravenbrook.com
2014-06-11 13:52:31 +01:00
Gareth Rees
224afa61a8
Fix problems identified by rb in review < https://info.ravenbrook.com/mail/2014/05/29/13-01-02/0/ >.
...
Copied from Perforce
Change: 186347
ServerID: perforce.ravenbrook.com
2014-05-29 14:50:36 +01:00
Gareth Rees
f5e11efb38
Improvements following review.
...
Copied from Perforce
Change: 186227
ServerID: perforce.ravenbrook.com
2014-05-21 00:43:06 +01:00
Gareth Rees
6c668c0c02
New function splaydebugcount counts the number of items in a splay tree (while checking its consistency).
...
Copied from Perforce
Change: 186182
ServerID: perforce.ravenbrook.com
2014-05-19 13:47:56 +01:00
Gareth Rees
d947fe9ff5
Replace the chunk ring with a chunk tree.
...
Fix bug in SplayFindNext (LESS and GREATER the wrong way round).
Copied from Perforce
Change: 186157
ServerID: perforce.ravenbrook.com
2014-05-17 17:05:42 +01:00
Gareth Rees
add3e4bf93
Consistent order stream, depth.
...
Copied from Perforce
Change: 186001
ServerID: perforce.ravenbrook.com
2014-05-11 18:30:23 +01:00
Gareth Rees
c44f2d6a20
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
4ed8190265
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
d83fbf6b09
Correct indentation of describe output.
...
Copied from Perforce
Change: 185626
ServerID: perforce.ravenbrook.com
2014-04-17 13:36:42 +01:00
Gareth Rees
b3f9ae76ae
Fix the condition for splaynodeupdate.
...
Copied from Perforce
Change: 185307
ServerID: perforce.ravenbrook.com
2014-04-07 16:26:03 +01:00
Gareth Rees
3d1db4eab6
Use cbs subclasses to implement the fast-find and find-in-zones features. this avoids the need to control behaviour by passing booleans, and it means that there is no wasted space in the cbs block structure when these features are not used.
...
Bring splay tree design up to date; add missing diagrams; move it to the "current" section of the manual.
Copied from Perforce
Change: 185294
ServerID: perforce.ravenbrook.com
2014-04-07 15:36:18 +01:00
Gareth Rees
0ffc9ec788
Can't use checkd_nosig(tree, ...) because treeempty is null.
...
arena->enabledMessageTypes might be NULL.
Copied from Perforce
Change: 185271
ServerID: perforce.ravenbrook.com
2014-04-07 10:14:40 +01:00
Gareth Rees
bcea6812fc
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
c94be13bdf
Improved support for pelles c:
...
* Refactor nmake files so that a compiler-specific makefile is included; move Microsoft Visual C-specific options to mv.nmk.
* Add nmake files for Pelles (w3i3pc.nmk and pc.nmk).
* Rename spw3i3mv.c to spw3i3.c and spw3i6mv.c to spw3i6.c since these are also used by Pelles C.
* Make reasonable changes to the source code to avoid warnings from Pelles C:
** check results of function calls;
** avoid useless return values;
** undef max before defining it;
** ensure printf formats are checkable;
** move notreached() assertions to the end of blocks;
** suppress warnings in cases where the code shouldn't be changed ("Unreachable code", "Inline assembly code is not portable", "Structured Exception Handling is not portable").
Copied from Perforce
Change: 184977
ServerID: perforce.ravenbrook.com
2014-03-24 18:23:29 +00:00
Richard Brooksby
4a27ce10f0
Catch-up merge from branch/2014-02-22/splay-tune to pick up code review changes.
...
Copied from Perforce
Change: 184727
ServerID: perforce.ravenbrook.com
2014-03-11 16:07:19 +00:00
Richard Brooksby
519f208a46
Responding to code review. see < https://info.ravenbrook.com/mail/2014/03/04/12-02-27/0/ >.
...
Copied from Perforce
Change: 184669
ServerID: perforce.ravenbrook.com
2014-03-07 15:00:54 +00:00
Richard Brooksby
c0e96f9f3c
Merging branch/2014-02-22/splay-tune to pick up splay tree improvements.
...
Copied from Perforce
Change: 184606
ServerID: perforce.ravenbrook.com
2014-02-28 14:27:40 +00:00
Richard Brooksby
7df4777d3c
Reinstating exhaustive splay tree search, since a tree or node may intersect a requested zone set, and be larger than a requested size, but still not satisfy a request.
...
Copied from Perforce
Change: 184594
ServerID: perforce.ravenbrook.com
2014-02-28 10:52:45 +00:00
Richard Brooksby
c518d82ca9
Reverting exhaustive search in splayfindfirst and splayfindlast since zoned cbs will use an accurate test on the cbs block zones property, and this code will never be exercised.
...
Copied from Perforce
Change: 184588
ServerID: perforce.ravenbrook.com
2014-02-28 00:47:42 +00:00
Richard Brooksby
ad6b8c27ab
Implementing splayfindlast to match splayfindfirst. oops.
...
Copied from Perforce
Change: 184578
ServerID: perforce.ravenbrook.com
2014-02-27 16:03:55 +00:00
Richard Brooksby
549f676bdb
Minor tweaks to comments.
...
Copied from Perforce
Change: 184550
ServerID: perforce.ravenbrook.com
2014-02-26 13:00:07 +00:00
Richard Brooksby
09ec0a866f
Moving and updating most of the usage documentation from the design document to the source code. design documentation should contain justification of design decisions, not a user manual.
...
Copied from Perforce
Change: 184547
ServerID: perforce.ravenbrook.com
2014-02-26 01:39:10 +00:00
Richard Brooksby
9cf1c6319c
Updating copyright dates.
...
Copied from Perforce
Change: 184510
ServerID: perforce.ravenbrook.com
2014-02-23 13:54:07 +00:00
Richard Brooksby
2c0a968b2e
Making splaysplit and splayassemble general so that they can be used easily.
...
Copied from Perforce
Change: 184452
ServerID: perforce.ravenbrook.com
2014-02-23 12:18:18 +00:00
Richard Brooksby
b9a6a613a8
Returning the results of splitting in a structure so that it’s easier to pass them on to assemble.
...
Copied from Perforce
Change: 184451
ServerID: perforce.ravenbrook.com
2014-02-23 12:10:52 +00:00
Richard Brooksby
72dcf4aa74
Removing unnecessary case of splaying empty trees.
...
Copied from Perforce
Change: 184450
ServerID: perforce.ravenbrook.com
2014-02-23 11:52:21 +00:00
Richard Brooksby
a7451a424a
Adding a signature to splay tree structure. miscellaneous documentation and naming clean-up.
...
Copied from Perforce
Change: 184448
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
9a9369cb59
Pointer-reversing splay and assemble to avoid double traversal of side tree spines in the update case.
...
Copied from Perforce
Change: 184447
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
00b45122ee
Lifting zig and zag cases into common prefix to shorten splaysplit. a few percent faster.
...
Copied from Perforce
Change: 184446
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
9d3bbb41dd
Moving downward splay updates to after side tree linkage, allowing the optimiser to do a better job. produces about 10% speedup: xc/release/djbench -x 1234 --sshift 8 mvff
...
Copied from Perforce
Change: 184445
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
a3e2e6bac3
Optimising splaytreeneighbours by observing that once one neighbour is found, the other neighbour is already in our hand in one of the side trees. this reduces the number of splays when coalescing.
...
Copied from Perforce
Change: 184443
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
26f8f1ddcd
Specialising left and right splay tree searches where no comparisons are necessary.
...
Copied from Perforce
Change: 184442
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
be51fa6829
Adding tree integrity check debugging function.
...
Copied from Perforce
Change: 184441
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
2a60898a04
Eliminating redundant passing of tree keys by adding a method to extract the key from a tree node.
...
Copied from Perforce
Change: 184440
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
d6d382cc34
Avoid dropping children of found node in non-update case. oops.
...
Copied from Perforce
Change: 184439
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
4c1c0009f8
Lifting out pointer-reversed updates.
...
Copied from Perforce
Change: 184438
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
959bc6b460
Generalising pointer reversal of tree spines.
...
Copied from Perforce
Change: 184437
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
4b18c932d8
Reducing excessive punctuation and removing unnecessary goto cases in splaysplay.
...
Copied from Perforce
Change: 184436
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
8fccc81c82
Avoiding general compare when searching for first and last nodes in a tree.
...
Copied from Perforce
Change: 184435
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
262de4e219
Fixing splaytreefind on empty tree. oops.
...
Regression test: xc/Debug/fbmtest 215526357
Copied from Perforce
Change: 184434
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
50146c866f
Splaysplay returns a compare to indicate the relationship of the new tree root to the key, eliminating some redundant tests, and making it more like treefind.
...
Allowing SplayTreeNext to deal with modification during iteration, so that iteration can be used to delete trees, for example.
Copied from Perforce
Change: 184433
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
a97757482b
Fixing abuses of res and resfail in the splay tree interface.
...
Copied from Perforce
Change: 184432
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
e7c3417c87
Generalising splayrotate operations into treerotates.
...
Copied from Perforce
Change: 184431
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
63d579da73
Replacing null with treeempty where that is intended.
...
Copied from Perforce
Change: 184430
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
0b3372d1d2
Distinguishing tree keys (treekey) from generic void *.
...
Copied from Perforce
Change: 184429
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
07ece0b4b3
Unifying splaycomparemethod with treecompare.
...
Copied from Perforce
Change: 184428
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
a0435161f2
Simplifying splay tree update prototype and removing special null case.
...
Copied from Perforce
Change: 184427
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
8a7f2671f4
Replacing splaynode with tree generally.
...
Copied from Perforce
Change: 184426
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00