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
Gareth Rees
e6605cc39c
Tidying up in anticipation of review.
...
Copied from Perforce
Change: 182524
ServerID: perforce.ravenbrook.com
2013-06-04 23:49:48 +01:00
Gareth Rees
ca36e1a147
Cbsdelete() now returns the isolated contiguous range that was found, even if the requested deletion operation cannot be performed. (this is so that the caller can try deleting the whole block instead and manage the fragments using a fallback strategy.)
...
CBSFindLargest() takes a size argument, so that the caller doesn't have to re-insert the found block if it wasn't large enough.
Copied from Perforce
Change: 182431
ServerID: perforce.ravenbrook.com
2013-06-03 16:16:04 +01:00
Gareth Rees
0260380dd3
Rename cbstest.c to fbmtest.c (free block management test) and generalize it so that it tests both the cbs and freelist modules.
...
Split FreelistFind into FreelistFindFirst and FreelistFindLast so that the interface exactly matches the CBS interface.
Fix errors in freelist.c: missing computation of size in FreelistBlockSetLimit; update linked list correct in coalesceRight case in FreelistInsert.
Avoid compiler warnings in freelist.c.
In cbs.c: use $U for Booleans ($B is for bit tables).
Copied from Perforce
Change: 182397
ServerID: perforce.ravenbrook.com
2013-06-02 21:34:23 +01:00
Gareth Rees
db9328da7a
Use range objects in the cbs interface instead of base, limit pairs. the idea is that freelist and cbs should offer similar interfaces so that the testing code can be shared.
...
Copied from Perforce
Change: 182364
ServerID: perforce.ravenbrook.com
2013-05-31 16:29:26 +01:00
Gareth Rees
934ae05ca3
Rename the enumeration cbsfinddelete to finddelete in anticipation of it being shared between cbs and new freelist module.
...
Since ABQDisposition enumeration only has two values, it's better to use Bool.
Copied from Perforce
Change: 182347
ServerID: perforce.ravenbrook.com
2013-05-31 00:09:33 +01:00
Gareth Rees
caf1945985
Clarify the logic in cbsinsertintotree to match cbsdeletefromtree.
...
Copied from Perforce
Change: 182344
ServerID: perforce.ravenbrook.com
2013-05-30 20:09:01 +01:00
Gareth Rees
71ab5adf66
Separate block allocation from block insertion, so that cbsdeletefromtree no longer leaves the tree in an inconsistent state if allocation fails.
...
Simplify the case logic in cbsDeleteFromTree to try to make it clearer.
Explain why cbsDeleteFromTree can't fail when it's called from cbsFindDeleteRange.
Copied from Perforce
Change: 182342
ServerID: perforce.ravenbrook.com
2013-05-30 19:22:56 +01:00
Gareth Rees
4c5bca4bd0
Fix review comments from rb in < https://info.ravenbrook.com/mail/2013/05/23/18-17-17/0/ >
...
Copied from Perforce
Change: 182149
ServerID: perforce.ravenbrook.com
2013-05-24 00:48:19 +01:00
Richard Brooksby
5d5e2cac05
Deleting some obsolete comment text about callbacks.
...
Renaming cbsBlockShrink to cbsBlockShrunk and cbsBlockGrow to cbsBlockGrew, since they don't *do* those things, just record that they were done.
Tidying up Find functions, where deletion of emergency code had left some strange double nestings.
Copied from Perforce
Change: 182120
ServerID: perforce.ravenbrook.com
2013-05-23 19:05:25 +01:00
Gareth Rees
ad523a34ef
Remove unused variable oldsize.
...
Copied from Perforce
Change: 182111
ServerID: perforce.ravenbrook.com
2013-05-23 12:50:57 +01:00
Gareth Rees
5ea309b5cc
Catch-up merge from master sources to branch/2013-05-17/emergency.
...
Copied from Perforce
Change: 182048
ServerID: perforce.ravenbrook.com
2013-05-21 18:31:50 +01:00
Gareth Rees
4ff81d94e7
Cbsdescribe provides more information about the cbs.
...
Copied from Perforce
Change: 182030
ServerID: perforce.ravenbrook.com
2013-05-21 13:25:17 +01:00
Gareth Rees
2849a0bd33
Make the cbs module more abstract by removing cbsblock from the public interface. avoid re-entrancy problems by removing the callback interface. public interfaces like cbsiteratemethod now operate in terms of address ranges rather than cbsblocks.
...
The functions CBSInsert, CBSDelete and CBSFind* now additionally return an "old" address range which gives the former base and limit of the block that has just been updated. This gives clients enough information to update their caches if need be.
Update CBS test and design accordingly.
Copied from Perforce
Change: 182014
ServerID: perforce.ravenbrook.com
2013-05-20 20:45:26 +01:00
Gareth Rees
217831cc47
Remove "emergency" free list allocator from the cbs module (it belongs in its own module) and update clients and the design accordingly.
...
Copied from Perforce
Change: 181927
ServerID: perforce.ravenbrook.com
2013-05-19 14:27:24 +01:00
Gareth Rees
cce6ee29c8
New macro mps_arg and revised macro mps_args_add mean that client programs no longer need to know which keyword argument goes in which field. revise documentation accordingly.
...
Copied from Perforce
Change: 181736
ServerID: perforce.ravenbrook.com
2013-05-12 17:21:03 +01:00
Richard Brooksby
80e84d09a5
Adding macros to make keyword argument list formation more convenient and robust.
...
Copied from Perforce
Change: 181666
ServerID: perforce.ravenbrook.com
2013-05-09 14:04:23 +01:00
Richard Brooksby
3189ccfc9b
Consolidating common pool keywords.
...
Copied from Perforce
Change: 181649
ServerID: perforce.ravenbrook.com
2013-05-09 00:06:07 +01:00
Richard Brooksby
07f446a450
Converting pools to use keyword arguments, mostly, and so far inconsistently, but at least it compiles.
...
Copied from Perforce
Change: 181635
ServerID: perforce.ravenbrook.com
2013-05-08 16:21:12 +01:00
Richard Brooksby
cb8f0ea514
Removing unnecessary unused declarations since changelist 179690.
...
Copied from Perforce
Change: 179691
ServerID: perforce.ravenbrook.com
2012-09-25 23:34:20 +01:00
Richard Brooksby
27c6706791
Merging branch/2012-08-21/diagnostic-telemetry.
...
Copied from Perforce
Change: 179289
ServerID: perforce.ravenbrook.com
2012-09-05 23:45:31 +01:00
Richard Brooksby
5333e6d525
Checking and suppressing warnings caused by higher level of optimisation and building from mps.c on ubuntu 12.
...
Copied from Perforce
Change: 179194
ServerID: perforce.ravenbrook.com
2012-09-03 13:38:53 +01:00
Richard Brooksby
89a685f164
Renaming some check* macros with more accurate names, making remaining check* macros similar in function.
...
Copied from Perforce
Change: 179155
ServerID: perforce.ravenbrook.com
2012-09-01 10:18:08 +01:00
Richard Brooksby
4009b8a559
Abolishing eventgen.pl. event structures are now expanded by the preprocessor.
...
Abolishing event formats. Each event now has its own structure.
Event parameters are now written directly into the event buffer, rather than being copied twice.
Copied from Perforce
Change: 179010
ServerID: perforce.ravenbrook.com
2012-08-21 22:48:11 +01: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 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