Gareth Rees
8e72725b5b
Assert that size > 0 in cbsfindlargest. (merged from change 184496.)
...
Copied from Perforce
Change: 186075
ServerID: perforce.ravenbrook.com
2014-05-13 13:44:42 +01:00
Gareth Rees
7985175687
Fixed a bug in cbsfindlargest where it always deleted the entire range found even when finddeletelow or finddeletehigh were passed. (merged from change 184493.)
...
Copied from Perforce
Change: 186074
ServerID: perforce.ravenbrook.com
2014-05-13 13:33:46 +01:00
Gareth Rees
58b2d71836
Bug fix. ensuring cbsfinddeleterange returns oldrangereturn even if it doesn’t delete a block. (merged from change 184485.)
...
Copied from Perforce
Change: 186070
ServerID: perforce.ravenbrook.com
2014-05-13 12:30:23 +01:00
Gareth Rees
3a1ce9493f
Remove mps_key_cbs_extend_by and mfsextendself keyword arguments to cbsinit. these were unused and obsoleted by cbsblockpool.
...
Copied from Perforce
Change: 186006
ServerID: perforce.ravenbrook.com
2014-05-11 19:09:44 +01:00
Gareth Rees
7620c6fcd1
Fix rash build on os x by adding the unused attribute to functions declared static that are not called in the rash variety.
...
Copied from Perforce
Change: 185915
ServerID: perforce.ravenbrook.com
2014-05-01 12:18:00 +01:00
Gareth Rees
9c8713f51b
Fix problems found by coverity. see < https://info.ravenbrook.com/mail/2014/04/10/23-23-42/0/ > for full analysis.
...
Copied from Perforce
Change: 185445
ServerID: perforce.ravenbrook.com
2014-04-11 00:26:48 +01:00
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
Richard Brooksby
687c50b762
Implementing top-down (last fit) allocation in zones.
...
Copied from Perforce
Change: 184771
ServerID: perforce.ravenbrook.com
2014-03-13 12:06:28 +00:00
Richard Brooksby
2ce13f82dc
Incomplete response to code review. see < https://info.ravenbrook.com/mail/2014/03/07/11-21-03/0/ >.
...
Copied from Perforce
Change: 184735
ServerID: perforce.ravenbrook.com
2014-03-11 16:39:11 +00:00
Richard Brooksby
2b9719e4bd
Catch-up merge from master.
...
Copied from Perforce
Change: 184732
ServerID: perforce.ravenbrook.com
2014-03-11 16:30:47 +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
16e0798806
Responding to code review < https://info.ravenbrook.com/mail/2014/03/07/22-40-36/0/ >.
...
Using TREE_ELT where appropriate.
Using AVERT consistently on Tree, but see job003691.
Copied from Perforce
Change: 184724
ServerID: perforce.ravenbrook.com
2014-03-11 15:46:51 +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
d1473656ee
Resolving questions left behind in fixmes.
...
Copied from Perforce
Change: 184609
ServerID: perforce.ravenbrook.com
2014-02-28 14:42:44 +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
0673536606
Fixing res/bool confusion found by “xc/debug/fbmtest 244032167”
...
Copied from Perforce
Change: 184595
ServerID: perforce.ravenbrook.com
2014-02-28 10:53:07 +00:00
Richard Brooksby
887c6e3845
Tidying up interfaces to cbsinit and cbsfindinzones.
...
Documenting assumptions about CBS block allocation used by the arena.
Copied from Perforce
Change: 184593
ServerID: perforce.ravenbrook.com
2014-02-28 10:30:32 +00:00
Richard Brooksby
14620f8c24
Simplifying the interface to cbsfindinzones.
...
Speeding up CBSFindInZones a bit.
Copied from Perforce
Change: 184589
ServerID: perforce.ravenbrook.com
2014-02-28 01:25:18 +00:00
Richard Brooksby
ddfec2c708
Eliminating complex zonedcbs adt and reintroducing a cbs with zone summaries. removing the default “high” segment preference, that caused the cbs trees to unbalance, and isn’t required outside of ep. considerable reduction in code and speed up, now at parity with master on test xc/release/gcbench -x 1234 amc
...
Copied from Perforce
Change: 184587
ServerID: perforce.ravenbrook.com
2014-02-28 00:35:05 +00:00
Richard Brooksby
3b3e01b10f
Searching the freecbs now respects the “high” preference, though not yet within blocks.
...
Copied from Perforce
Change: 184574
ServerID: perforce.ravenbrook.com
2014-02-26 19:29:05 +00:00
Richard Brooksby
dc83b10c0d
Fixing cbsfindfirstinzones to return a res, because it can fail when it can’t allocate a cbs block, unlike cbsfindfirst.
...
Fixing related corner case in arenaAllocFindInFreeCBS when it thought it couldn’t find a block when it was in fact running out of nodes. This was revealed by “gcbench --npass 1 --arena-size 1M --seed 945632066 --niter 1 amc”.
Fixing draft ArenaFreeCBSDelete after exercising it.
Copied from Perforce
Change: 184568
ServerID: perforce.ravenbrook.com
2014-02-26 17:40:39 +00:00
Richard Brooksby
4fdddc36e0
Backing out zone set summary in the cbs. this isn't needed for speed now that there's a cbs per zone in the arena, and it will slow down all other cbss.
...
Copied from Perforce
Change: 184561
ServerID: perforce.ravenbrook.com
2014-02-26 14:24:34 +00:00
Gareth Rees
6971bee496
Make mps_args_done obsolete.
...
Copied from Perforce
Change: 184543
ServerID: perforce.ravenbrook.com
2014-02-26 12:47:27 +00:00
Richard Brooksby
8f85caa56e
Fixing bug where cbs overwrites its own blockpool pointer with garbage.
...
Copied from Perforce
Change: 184532
ServerID: perforce.ravenbrook.com
2014-02-25 19:19:37 +00:00
Richard Brooksby
5f9e072412
Bug fix. nonsensical case in cbsfindlargest when size is passed as zero.
...
Added RangeCopy.
Copied from Perforce
Change: 184496
ServerID: perforce.ravenbrook.com
2014-02-24 23:02:42 +00:00
Richard Brooksby
7db856f7b8
Fixed a bug in cbsfindlargest where it always deleted the entire range found even when finddeletelow or finddeletehigh were passed.
...
Copied from Perforce
Change: 184493
ServerID: perforce.ravenbrook.com
2014-02-24 22:48:48 +00:00
Richard Brooksby
a28fda3fc5
Making assertions in cbsupdatenode critical, since this is extremely hot in any cbs with fast find.
...
Copied from Perforce
Change: 184492
ServerID: perforce.ravenbrook.com
2014-02-24 22:27:16 +00:00
Richard Brooksby
b876c0ff82
Only finishing the cbs block pool when cbs created it. oops.
...
Copied from Perforce
Change: 184488
ServerID: perforce.ravenbrook.com
2014-02-24 21:14:40 +00:00
Richard Brooksby
5fc0d82d6a
Initialising a shared inline mfs for the cbss in mvff so that mvff can be used as the arena’s bootstrap and control pool.
...
Copied from Perforce
Change: 184486
ServerID: perforce.ravenbrook.com
2014-02-24 21:14:40 +00:00
Richard Brooksby
bdd84a3a0f
Bug fix. ensuring cbsfinddeleterange returns oldrangereturn even if it doesn’t delete a block.
...
Copied from Perforce
Change: 184485
ServerID: perforce.ravenbrook.com
2014-02-24 21:14:39 +00:00
Richard Brooksby
a8720f2615
Adding cbssize and freelistsize functions to calculate the size of freelist contents.
...
Copied from Perforce
Change: 184466
ServerID: perforce.ravenbrook.com
2014-02-23 20:59:44 +00:00
Richard Brooksby
f47100fd09
Permitting tree traversals to abort early.
...
Copied from Perforce
Change: 184511
ServerID: perforce.ravenbrook.com
2014-02-23 15:36:27 +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
a52bb1d3ea
Implementing pointer-reversing tree traversal that does not disturb the tree shape, unlike the splay tree traversal, which flattens the tree into a list. replacing cbsiterate with this, knocking about 25% off the runtime of the test case: xc/release/djbench -x 1234 --sshift 8 mvff
...
Copied from Perforce
Change: 184444
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
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
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
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
02dd6ce371
Desmurfing the naming conventions in cbs.
...
Copied from Perforce
Change: 184424
ServerID: perforce.ravenbrook.com
2014-02-23 10:41:14 +00:00
Richard Brooksby
f0b07f7bbe
Added a pool argument to cbs creation so that cbss can share a pool. in particular, per-zone allocation cbss for the arena can share a single special block pool.
...
Copied from Perforce
Change: 184469
ServerID: perforce.ravenbrook.com
2014-02-18 13:53:56 +00:00
David Lovemore
15975c2442
Add zone set to cbs nodes for faster zone set allocation.
...
Copied from Perforce
Change: 184299
ServerID: perforce.ravenbrook.com
2014-02-05 15:04:40 +00:00
Richard Brooksby
cd4a12047f
Non-working preferential allocation within a block of the cbs.
...
This doesn't work because the splay tree can't cope with homing in on a node (that appears big enough) then being told that it isn't suitable (because it doesn't have space in the right zone). The splay tree summary condition must be precise, as stated in the design. The splay tree isn't suited to this kind of search.
Copied from Perforce
Change: 184073
ServerID: perforce.ravenbrook.com
2014-01-21 16:29:30 +00:00
Richard Brooksby
6954977079
First draft of allocating using the freecbs. arenaalloc finds a free address range in the cbs and asks the arena class to mark it allocated, rather than the arena class doing the search. plenty still missing. no freeing.
...
Copied from Perforce
Change: 184050
ServerID: perforce.ravenbrook.com
2014-01-18 17:16:10 +00:00
Richard Brooksby
9eeaa3a388
Inlining the mfs block pool's structure into its parent mfs, to avoid allocating in the control pool when initialising a cbs. this will allow the cbs to be used before the control pool exists.
...
Copied from Perforce
Change: 184043
ServerID: perforce.ravenbrook.com
2014-01-17 15:48:12 +00:00