Gareth Rees
f2776dc0b4
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
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
9d5266c0cc
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
1e8eec530b
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
4e28809e4a
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
d8362f2cad
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
31b493236c
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
1ef160e7b1
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
6b17c88c69
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
dc4652b271
Minor tweaks to comments.
...
Copied from Perforce
Change: 184550
ServerID: perforce.ravenbrook.com
2014-02-26 13:00:07 +00:00
Richard Brooksby
4ef9c96411
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
59334b5e4f
Updating copyright dates.
...
Copied from Perforce
Change: 184510
ServerID: perforce.ravenbrook.com
2014-02-23 13:54:07 +00:00
Richard Brooksby
8eb1c7b647
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
bcdce5b35d
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
42a8ffbe6a
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
1ac9877082
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
29cba255f2
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
96be04cb42
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
660c0821d6
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
4e1d9e6a96
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
d48028902e
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
17b72c3052
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
fee5ac310e
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
2bb859f62b
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
f951709e99
Lifting out pointer-reversed updates.
...
Copied from Perforce
Change: 184438
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
93a0ffe8ee
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
35ab73ab4a
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
6eef655629
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
6219c50ca1
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
5cdcef0154
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
15c5b6dfc5
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
6bc35c5ca0
Generalising splayrotate operations into treerotates.
...
Copied from Perforce
Change: 184431
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
c446abda38
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
d04f3c0bc4
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
27373efc5c
Unifying splaycomparemethod with treecompare.
...
Copied from Perforce
Change: 184428
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
a6d87c91a8
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
2e5ca2df04
Replacing splaynode with tree generally.
...
Copied from Perforce
Change: 184426
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
85b11f7b55
Replacing splaynodestruct with treestruct and basic tree navigation operations in the splay tree implementation.
...
Copied from Perforce
Change: 184425
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:15 +00:00
Richard Brooksby
deb3237c44
Allowing splayfindfirst to continue to search even if the treetest is not precise, allowing the arena allocator to search for free areas using a zone preference.
...
Copied from Perforce
Change: 184129
ServerID: perforce.ravenbrook.com
2014-01-26 14:01:37 +00:00
Richard Brooksby
61890da12b
Fixing up occurences of "unsigned long" in the main mps and test code so that we no longer assume that "unsigned long" is large enough for a pointer or size, or that it's the longest available integer type, since these are not true on 64-bit windows.
...
Copied from Perforce
Change: 178021
ServerID: perforce.ravenbrook.com
2012-04-23 16:20:40 +01:00
Richard Brooksby
382d044e97
Cbs and splay now pass size through as closure parameters, rather than messing with unsigned long.
...
Copied from Perforce
Change: 177816
ServerID: perforce.ravenbrook.com
2012-03-27 17:15:25 +01:00
Richard Kistruck
445b3e6f51
Mps sort out baroque check macros (mainly config.h and check.h)
...
See job001248. Should be source-only change. Details:
CheckNONE,SHALLOW,DEEP -->> CheckLevelMINIMAL,SHALLOW,DEEP
[PROD_]CHECK_DEFAULT -->> [PROD_]CHECKLEVEL_INITIAL
CHECK[_NONE] -->> AVER_AND_CHECK[_NONE]
And add some comments.
Copied from Perforce
Change: 161210
ServerID: perforce.ravenbrook.com
2006-12-13 14:45:49 +00:00
Richard Kistruck
09cf54c122
Split-asserts: where an aver or checkl has two failure modes combined
...
with &&, split it into two AVERs or CHECKLs.
Copied from Perforce
Change: 155170
ServerID: perforce.ravenbrook.com
2005-09-30 10:50:48 +01:00
Richard Brooksby
e854cd8e1d
Merging branch mps/2002-05-22/open-source-prep.
...
Making some new files consistent with changes from that branch.
Deleting some new Global Graphics confidential files.
Copied from Perforce
Change: 30256
ServerID: perforce.ravenbrook.com
2002-06-18 16:19:34 +01:00
Nick Barnes
6a1a360814
Integrate changes from global graphics.
...
Copied from Perforce
Change: 30250
ServerID: perforce.ravenbrook.com
2002-06-18 14:14:55 +01:00
Richard Brooksby
78ef580722
Eliminating "impl" type tags and replacing them with uri-style file references.
...
Copied from Perforce
Change: 29900
ServerID: perforce.ravenbrook.com
2002-06-07 17:34:59 +01:00
Richard Brooksby
97075f7053
Updating cross references to design documents to html style, to go with master/design document tree.
...
Copied from Perforce
Change: 29897
ServerID: perforce.ravenbrook.com
2002-06-07 16:47:14 +01:00
Richard Brooksby
a0f676c8e1
Adding forward reference to licenses from copyright notices.
...
Adding licenses to a couple of files I missed.
Copied from Perforce
Change: 29837
ServerID: perforce.ravenbrook.com
2002-06-06 11:56:19 +01:00
Richard Brooksby
4301a6db0a
Adding licenses to source code files.
...
Copied from Perforce
Change: 29836
ServerID: perforce.ravenbrook.com
2002-06-06 11:44:23 +01:00
Nick Barnes
db4b3a6fa5
Remove trailing whitespace.
...
Copied from Perforce
Change: 25309
ServerID: perforce.ravenbrook.com
2001-12-17 15:18:17 +00:00