Gareth Rees
0b204bf4e7
Catch-up merge from master sources to mps/branch/2013-05-17/emergency.
...
Copied from Perforce
Change: 182518
ServerID: perforce.ravenbrook.com
2013-06-04 20:44:03 +01:00
Gareth Rees
3cd8c3964f
Avoid "variable may be used uninitialized" warning from visual c.
...
Copied from Perforce
Change: 182517
ServerID: perforce.ravenbrook.com
2013-06-04 20:41:19 +01:00
Gareth Rees
3c5b19a611
Reorganize windows build so that facts are mentioned in only one place.
...
Provide "testrun" target (and batch file) for running the test suite.
Copied from Perforce
Change: 182516
ServerID: perforce.ravenbrook.com
2013-06-04 20:40:07 +01:00
Gareth Rees
7288e21131
Avoid "variable may be used uninitialized" warnings.
...
Copied from Perforce
Change: 182513
ServerID: perforce.ravenbrook.com
2013-06-04 18:46:07 +01:00
Gareth Rees
cb2aea227c
Make fotest run on lii6gc.
...
Copied from Perforce
Change: 182512
ServerID: perforce.ravenbrook.com
2013-06-04 18:40:52 +01:00
Gareth Rees
d6912235bd
Mvt now fails over from a cbs to a freelist.
...
Update test cases and design accordingly.
Copied from Perforce
Change: 182509
ServerID: perforce.ravenbrook.com
2013-06-04 18:16:32 +01:00
Gareth Rees
938f1945fa
Encapsulate cbsfindlargest falling back to freelistfindlargest as suggested by rb in review.
...
Copied from Perforce
Change: 182502
ServerID: perforce.ravenbrook.com
2013-06-04 17:10:38 +01:00
Gareth Rees
2bda69bc6b
New test case "fotest" for fail-over of cbs to freelist in mvff. (plus stub for mvt.) need some testing hooks in mvff and mvt for getting the cbs.
...
This reveals a couple of bugs in MVFF: (i) if CBSDelete fails, this might be because the block is actually on the Freelist instead; (ii) we can't SegFree before calling FreelistDelete because the Freelist needs access to the memory in order to read its pointers.
Copied from Perforce
Change: 182500
ServerID: perforce.ravenbrook.com
2013-06-04 16:51:24 +01:00
Gareth Rees
9c3831f28e
Missing extern.
...
Copied from Perforce
Change: 182496
ServerID: perforce.ravenbrook.com
2013-06-04 15:40:45 +01:00
Gareth Rees
fc5666204f
Call abort() instead of exit() for convenience when debugging.
...
Copied from Perforce
Change: 182495
ServerID: perforce.ravenbrook.com
2013-06-04 15:37:12 +01:00
Gareth Rees
6f356edfb1
In mvff, fall back from cbs to freelist if cbs fails.
...
Copied from Perforce
Change: 182434
ServerID: perforce.ravenbrook.com
2013-06-03 16:21:52 +01:00
Gareth Rees
8d8d553cbf
Add fbmtest to test suite.
...
Copied from Perforce
Change: 182433
ServerID: perforce.ravenbrook.com
2013-06-03 16:21:32 +01:00
Gareth Rees
f0def15a48
Freelistfindlargest() takes a size argument so that the interface matches cbsfindlargest().
...
New function FreelistFlushToCBS() tries to move all blocks out of a free list and into a CBS.
Copied from Perforce
Change: 182432
ServerID: perforce.ravenbrook.com
2013-06-03 16:17:28 +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
be868669e3
Use rnd() from testlib instead for rand() from libc, so that test case is repeatable.
...
Copied from Perforce
Change: 182430
ServerID: perforce.ravenbrook.com
2013-06-03 16:05:19 +01:00
Gareth Rees
9c9e1668a1
Make sure fbmtest compiles and runs on lii6gc.
...
Copied from Perforce
Change: 182425
ServerID: perforce.ravenbrook.com
2013-06-03 13:08:55 +01:00
Gareth Rees
c9780a3401
Add freelist module to core mps.
...
Copied from Perforce
Change: 182422
ServerID: perforce.ravenbrook.com
2013-06-03 12:58:12 +01:00
Richard Brooksby
ead194349a
Miscellaneous design document improvements.
...
Documenting why WriteF on points comes out with the wrong endianness on Intel platforms.
Copied from Perforce
Change: 182421
ServerID: perforce.ravenbrook.com
2013-06-03 12:57:55 +01:00
Gareth Rees
f154b62bf4
Catch-up merge from master sources to mps/branch/2013-05-17/emergency
...
Copied from Perforce
Change: 182417
ServerID: perforce.ravenbrook.com
2013-06-03 12:25:18 +01:00
Gareth Rees
5a508d2178
Run apss test in a client arena as well as vm arenas.
...
Copied from Perforce
Change: 182416
ServerID: perforce.ravenbrook.com
2013-06-03 12:19:55 +01:00
Gareth Rees
e07ee8b8e3
Make expt825 and awlutth test cases build on os x.
...
Add exposet0, expt825 and zmess test cases to test suite on OS X.
Copied from Perforce
Change: 182415
ServerID: perforce.ravenbrook.com
2013-06-03 12:18:05 +01:00
Gareth Rees
b764d4b19d
Improve organization of comm.gmk:
...
* Mention each target once (this makes it more reliable to modify the set of targets).
* Include exposet0, expt825 and xmess in the automatically run test cases.
* For other test cases, explain why not included in automated test suite.
* Organize targets alphabetically (this is makes it easier to check the lists against each other).
Copied from Perforce
Change: 182413
ServerID: perforce.ravenbrook.com
2013-06-03 11:35:01 +01:00
Gareth Rees
d959e65927
Missing prototypes for freelistfindfirst and freelistfindlast.
...
Copied from Perforce
Change: 182411
ServerID: perforce.ravenbrook.com
2013-06-03 11:08:58 +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
83aff660e2
Use a tag in the bottom bit to distinguish grains and blocks in the free list. this results in much simplification of the code.
...
Copied from Perforce
Change: 182362
ServerID: perforce.ravenbrook.com
2013-05-31 13:41:36 +01:00
Gareth Rees
915a41123c
Fix iteration in freelistfindlargest.
...
Copied from Perforce
Change: 182359
ServerID: perforce.ravenbrook.com
2013-05-31 10:44:02 +01:00
Gareth Rees
e26cba758a
Mustn't use aver in describe functions.
...
Copied from Perforce
Change: 182358
ServerID: perforce.ravenbrook.com
2013-05-31 10:43:38 +01:00
Gareth Rees
04f2738a18
Improve documentation. fix off-by-one errors in the setprevnext functions.
...
Copied from Perforce
Change: 182350
ServerID: perforce.ravenbrook.com
2013-05-31 00:41:28 +01:00
Gareth Rees
032657464b
New "freelist" module implementes a simple address-ordered linked list allocator (based on the "emergency list" allocator that was formerly part of the cbs module).
...
Copied from Perforce
Change: 182348
ServerID: perforce.ravenbrook.com
2013-05-31 00:12:49 +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
aa16236b2a
Ansi i/o module checks its arguments using aver.
...
Copied from Perforce
Change: 182327
ServerID: perforce.ravenbrook.com
2013-05-30 16:21:42 +01:00
Gareth Rees
dad0cabdf7
Guard the calls to mps_io_flush so that it can only be called after mps_io_create.
...
Copied from Perforce
Change: 182322
ServerID: perforce.ravenbrook.com
2013-05-30 15:24:41 +01:00
Gareth Rees
87019f4ee2
Fix review comments from < https://info.ravenbrook.com/mail/2013/05/28/22-21-11/0/ >:
...
* Rename RangeOverlap to RangesOverlap.
* MVFF shouldn't assume that CBSInsert and CBSDelete can't fail.
* Remove unused function mps_mvff_stat.
* Don't call range methods in RangeCheck.
* RangeInit can't fail, so return void.
Copied from Perforce
Change: 182297
ServerID: perforce.ravenbrook.com
2013-05-29 12:19:19 +01:00
Gareth Rees
30d713920b
Add mvt to ap stress test.
...
Copied from Perforce
Change: 182269
ServerID: perforce.ravenbrook.com
2013-05-27 21:48:06 +01:00
Gareth Rees
3aa19f30a4
Assert instead of crashing in mps_arena_destroy when the client has failed to destroy some data structures.
...
Also, don't forget to finish the chainRing.
Copied from Perforce
Change: 182258
ServerID: perforce.ravenbrook.com
2013-05-27 12:58:05 +01:00
Gareth Rees
4bd6bde604
Mfs now rounds unitsize up to unit_min instead of asserting.
...
Copied from Perforce
Change: 182257
ServerID: perforce.ravenbrook.com
2013-05-27 10:19:35 +01:00
Gareth Rees
b6c356d1d8
Snc requires a format, so it needs a varargs decoder.
...
Copied from Perforce
Change: 182256
ServerID: perforce.ravenbrook.com
2013-05-27 10:14:38 +01:00
Richard Brooksby
5c6785b815
Catch-up merge from custom/cet/main to master.
...
Includes installable assertion handler, events in circular memory buffers, LARGEADDRESSAWARE, etc.
Copied from Perforce
Change: 182176
ServerID: perforce.ravenbrook.com
2013-05-24 19:42:46 +01:00
Gareth Rees
ba1a45d970
Catch-up merge from master sources to mps/branch/2013-05-17/emergency.
...
Copied from Perforce
Change: 182170
ServerID: perforce.ravenbrook.com
2013-05-24 18:44:18 +01:00
Gareth Rees
da75b40c73
Always run all the testcases, noting failures instead of stopping.
...
Copied from Perforce
Change: 182153
ServerID: perforce.ravenbrook.com
2013-05-24 11:25:15 +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
Gareth Rees
09b845a726
Catch-up merge from the master sources to branch/2013-05-17/emergency.
...
Copied from Perforce
Change: 182135
ServerID: perforce.ravenbrook.com
2013-05-23 20:58:21 +01:00
Gareth Rees
8396204108
Ensure that the random seed is not lost in case of failure.
...
Copied from Perforce
Change: 182131
ServerID: perforce.ravenbrook.com
2013-05-23 20:10:36 +01:00
Gareth Rees
0206d9feb2
Amcssth need to be added "all" as well as testcases.
...
Copied from Perforce
Change: 182129
ServerID: perforce.ravenbrook.com
2013-05-23 20:06:45 +01:00
Gareth Rees
3c48eff730
On platform lii6gc, the mps needs a bunch of symbols which are not defined if the -ansi option is given to gcc. these can be enabled by defining features like _gnu_source, but all headers share a common set of features (via <feature.h>) and so all sources in the same compilation unit must turn on the same set of features. make sure this happens by turning on the features in config.h (not mpstd.h).
...
Remove <string.h> from mpsi.h (not needed).
Copied from Perforce
Change: 182124
ServerID: perforce.ravenbrook.com
2013-05-23 19:35:47 +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
Richard Brooksby
af707b5d97
Clarifying comment about extra queue element
...
Copied from Perforce
Change: 182119
ServerID: perforce.ravenbrook.com
2013-05-23 19:04:42 +01:00