Richard Brooksby
aa0412e071
Removing the mostly unused size component of the closure convention.
...
Copied from Perforce
Change: 189503
ServerID: perforce.ravenbrook.com
2016-03-01 17:20:50 +00:00
Gareth Rees
afb5ff33c1
Correct the test for too-small client arena sizes.
...
Add automated test case for client arenas with small sizes.
Copied from Perforce
Change: 188099
ServerID: perforce.ravenbrook.com
2015-08-10 11:41:58 +01:00
Gareth Rees
6359b0ed98
Merge branch/2014-09-29/reserved into the master sources.
...
Copied from Perforce
Change: 188090
ServerID: perforce.ravenbrook.com
2015-08-07 16:33:43 +01:00
Gareth Rees
0c42e3aa23
Improved assertion messages when a required keyword argument is not found. instead of "unreachable code", the assertion message is the name of the missing key.
...
Copied from Perforce
Change: 187267
ServerID: perforce.ravenbrook.com
2014-10-14 22:05:30 +01:00
Gareth Rees
05ac242c57
If you try to create a client arena that's too small for the full complement of zones, return mps_res_memory instead of asserting.
...
If you try to create a virtual memory arena that's too small for the full complement of zones, round up the size to the minimum instead of asserting.
Copied from Perforce
Change: 187164
ServerID: perforce.ravenbrook.com
2014-10-08 22:16:56 +01:00
Gareth Rees
88ca7174e7
Remove unused(boot) as boot is not unused.
...
No need for NOOP -- even without the UNUSED statement above it, an empty block would be legal in C.
Copied from Perforce
Change: 187147
ServerID: perforce.ravenbrook.com
2014-10-07 10:20:28 +01:00
Gareth Rees
72209444c0
Store reserved address space associated with chunk in a field in the chunkstruct, as suggested by rb in < https://info.ravenbrook.com/mail/2014/10/01/13-55-44/0/ >.
...
Copied from Perforce
Change: 187104
ServerID: perforce.ravenbrook.com
2014-10-01 21:40:50 +01:00
Gareth Rees
f9a37d2942
Document the behaviour of committed (memory marked as in use) and spare_committed (always zero) in the client arena class.
...
Account for (and check) committed memory in the client arena class.
Can't check arena->committed <= arena->reserved in ArenaCheck, but can in ClientArenaCheck.
Rename ClientFree to ClientArenaFree to match the naming convention elsewhere.
Copied from Perforce
Change: 187093
ServerID: perforce.ravenbrook.com
2014-09-30 20:04:35 +01:00
Gareth Rees
53c5301a9e
Instead of iterating over the chunks to compute the total reserved address space, maintain a running total in arenachunkinsert and (new function) arenachunkremoved.
...
New arena class method chunkReserved handles the class-specific computation of the reserved size of a chunk.
Copied from Perforce
Change: 187089
ServerID: perforce.ravenbrook.com
2014-09-29 22:50:46 +01:00
Gareth Rees
83a93881a2
Design.mps.ring.naming: "when one structure parent contains one ring of child structures, the field in parent is usually known as childring, and the field in child is known as parentring". so the field in chunkstruct should be named arenaring.
...
Copied from Perforce
Change: 187084
ServerID: perforce.ravenbrook.com
2014-09-29 20:54:00 +01:00
Gareth Rees
414719db23
Round up the grain size in the client arena to arena_client_grain_size (otherwise the grain might be so small that the page table uses up all the space in the chunk).
...
Copied from Perforce
Change: 186689
ServerID: perforce.ravenbrook.com
2014-06-19 14:10:30 +01:00
Gareth Rees
07912c0833
Fix problems noted by dl in review < https://info.ravenbrook.com/mail/2014/06/17/13-35-38/0/ >.
...
Copied from Perforce
Change: 186662
ServerID: perforce.ravenbrook.com
2014-06-17 15:15:32 +01:00
Gareth Rees
c975f64296
Improve the diff and make the vm implementations more closely parallel.
...
Copied from Perforce
Change: 186591
ServerID: perforce.ravenbrook.com
2014-06-13 17:59:37 +01:00
Gareth Rees
831f551eec
Now that we can call vmpagesize without having a vm to hand, the implementation of vmcreate can be simpler: in particular, the grain size can already be correctly rounded up.
...
Copied from Perforce
Change: 186590
ServerID: perforce.ravenbrook.com
2014-06-13 17:39:58 +01:00
Gareth Rees
88c85abc0e
Vmpagesize now takes no arguments -- this avoids suggesting (incorrectly) that it might return a different value for each vm.
...
New function ProtGranularity returns the protection granularity of the operating system. (On all currently supported operating systems this is the same as the granularity of memory mapping returned by VMPageSuze, but it's important to separate these concepts.) MPMCheck asserts that the granularity of memory mapping is a multiple of the granularity of protection.
Client arena supports MPS_KEY_ARENA_GRAIN_SIZE.
Some of the test cases set the arena grain size.
Copied from Perforce
Change: 186588
ServerID: perforce.ravenbrook.com
2014-06-13 17:19:23 +01:00
Gareth Rees
8ecf6264f4
Configurable grain size for client arenas.
...
Copied from Perforce
Change: 186579
ServerID: perforce.ravenbrook.com
2014-06-13 16:24:55 +01:00
Gareth Rees
a13a1aa1df
Catch-up merge from master sources @186564 to branch/2014-06-11/grain.
...
Copied from Perforce
Change: 186572
ServerID: perforce.ravenbrook.com
2014-06-13 15:30:46 +01:00
Gareth Rees
100405cac2
Restore the chunk ring.
...
Copied from Perforce
Change: 186558
ServerID: perforce.ravenbrook.com
2014-06-13 12:31:47 +01:00
Gareth Rees
8c9de5f775
New function arenachunktreetraverse ensures that calls to chunkofaddr are reliably detected.
...
Copied from Perforce
Change: 186550
ServerID: perforce.ravenbrook.com
2014-06-12 20:28:50 +01:00
Gareth Rees
bfb0b771dd
Rename "arena alignment" to "arena grain size" to avoid confusion with ordinary structure alignment.
...
Copied from Perforce
Change: 186503
ServerID: perforce.ravenbrook.com
2014-06-11 17:13:03 +01:00
Gareth Rees
a331b13075
Use unused_pointer and unused_size now we have 'em.
...
Copied from Perforce
Change: 186492
ServerID: perforce.ravenbrook.com
2014-06-11 13:59:02 +01:00
Gareth Rees
2087688964
Fix problems identified by rb in review < https://info.ravenbrook.com/mail/2014/06/05/14-58-24/0/ >.
...
Copied from Perforce
Change: 186451
ServerID: perforce.ravenbrook.com
2014-06-08 22:10:21 +01:00
Gareth Rees
58f35172c7
Tree_traverse_and_delete is a better name than tree_destroy.
...
Generalize this macro so it can be used in all three cases.
Copied from Perforce
Change: 186228
ServerID: perforce.ravenbrook.com
2014-05-21 11:38:59 +01:00
Gareth Rees
a0e076be57
Improvements following review.
...
Copied from Perforce
Change: 186227
ServerID: perforce.ravenbrook.com
2014-05-21 00:43:06 +01:00
Gareth Rees
2f0ef9355d
Clarify tracefix logic by unwinding the nested conditions.
...
Change the arena's chunk tree from a splay tree to an ordinary tree (so that it's not possible to accidentally splay it and leave it unbalanced).
New function TreeFindNext allows us to implement TractFirst and TractNext without having to splay the tree.
Make sure all operations on the chunk tree leave it balanced. But don't balance the tree directly in ChunkFinish() because this is only ever called in a loop where multiple chunks are being deleted from the tre. Instead use the sequence TreeToVine -- iterate and delete -- TreeBalance. The new macro TREE_DESTROY assists with this.
No need any more for ArenaIsReservedAddr, CHUNK_OF_ADDR, TRACT_OF_ADDR.
Update design documentation.
Copied from Perforce
Change: 186212
ServerID: perforce.ravenbrook.com
2014-05-20 18:12:37 +01:00
Gareth Rees
0b0a465674
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
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
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
673eea41a0
Check classes after defining them.
...
Copied from Perforce
Change: 185228
ServerID: perforce.ravenbrook.com
2014-04-04 12:51:07 +01:00
Richard Brooksby
4eec2493b7
Adding a keyword to the arena to disable zoned allocation.
...
Copied from Perforce
Change: 184599
ServerID: perforce.ravenbrook.com
2014-02-28 13:20:06 +00:00
Richard Brooksby
a1a14a1683
Implementing allocation in the client arena class.
...
Copied from Perforce
Change: 184596
ServerID: perforce.ravenbrook.com
2014-02-28 11:23:59 +00:00
Richard Brooksby
2151d00c7f
Catch-up merge from master, mainly to pick up spare-ring merge.
...
Copied from Perforce
Change: 184365
ServerID: perforce.ravenbrook.com
2014-02-18 13:47:49 +00:00
Richard Brooksby
4fc8971802
Minor updates in response to review. see https://info.ravenbrook.com/mail/2014/02/17/16-27-18/0/
...
Copied from Perforce
Change: 184354
ServerID: perforce.ravenbrook.com
2014-02-17 16:45:12 +00:00
Richard Brooksby
8679bb210f
Catch-up merge from master, mainly to pick up gcbench.
...
Copied from Perforce
Change: 184335
ServerID: perforce.ravenbrook.com
2014-02-12 17:39:31 +00:00
Richard Brooksby
bc47522ae2
Abstracting partially mapped page tables into a sparsearray abstract datatype, removing a great deal of complexity from the vm arena, and some unnecessary double-initialisation and scanning loops during allocation.
...
Copied from Perforce
Change: 184333
ServerID: perforce.ravenbrook.com
2014-02-12 17:32:20 +00:00
Richard Brooksby
252383465b
Abolishing vmarenaalloc and its horrible relatives.
...
Removing redundant SegPref structures from pools that only ever used the default.
Abolishing the VMNZ arena class, to be replaced with an option to ArenaCreate.
Copied from Perforce
Change: 184293
ServerID: perforce.ravenbrook.com
2014-02-04 18:10:53 +00:00
Richard Brooksby
f0ca8855e3
Converting some ancient “@@@@“ marked items into todo marked actions.
...
Copied from Perforce
Change: 184261
ServerID: perforce.ravenbrook.com
2014-01-30 19:33:14 +00:00
Richard Brooksby
e50418ce54
Tidying up the bootstrap so that every chunk gets added to the arena’s freecbs.
...
Copied from Perforce
Change: 184238
ServerID: perforce.ravenbrook.com
2014-01-30 15:44:46 +00:00
Richard Brooksby
d384362757
Ensuring that the arena passes consistency checking before calling vmarenatrivextended, by setting the zoneshift and alignment at the same time.
...
Copied from Perforce
Change: 182708
ServerID: perforce.ravenbrook.com
2013-06-12 20:02:29 +01:00
Richard Brooksby
3b37d681c2
Linking tags to mmprevol requests (e.g. request.epcode.12345) to their location on info.ravenbrook.com.
...
Copied from Perforce
Change: 182526
ServerID: perforce.ravenbrook.com
2013-06-05 00:57:04 +01:00
Richard Brooksby
9cd658a534
Renaming some local variables from "index" to "indx" to avoid shadowing the function "index".
...
Only certain versions of GCC seem to warn about this, but they include 4.6.3 being used by Tracis CI causing this failure <https://travis-ci.org/Ravenbrook/mps-temporary/builds/7322161 >.
Copied from Perforce
Change: 182011
ServerID: perforce.ravenbrook.com
2013-05-20 19:37:18 +01:00
Richard Brooksby
bb02f55b62
Making clear the size of the array of args passed to varargs conversion methods.
...
Copied from Perforce
Change: 181845
ServerID: perforce.ravenbrook.com
2013-05-16 03:12:11 +01:00
Gareth Rees
4c43a964d1
Rename mps_key_arena_cl_addr to mps_key_arena_cl_base.
...
Copied from Perforce
Change: 181739
ServerID: perforce.ravenbrook.com
2013-05-12 18:12:47 +01:00
Richard Brooksby
f4416c7efc
Changing required keyword arguments to cause an assertion rather than return a status code, and removing repetition in how this is expressed.
...
Copied from Perforce
Change: 181674
ServerID: perforce.ravenbrook.com
2013-05-09 15:15:40 +01:00
Richard Brooksby
03c7de38b6
Macroizing keyword definitions and adding more keyword argument checking methods.
...
Copied from Perforce
Change: 181647
ServerID: perforce.ravenbrook.com
2013-05-08 23:40:40 +01:00
Richard Brooksby
d512863efb
Moving arena varags parsing into arena class method, similar to pools. much simpler. all tests pass.
...
Copied from Perforce
Change: 181643
ServerID: perforce.ravenbrook.com
2013-05-08 23:00:00 +01:00
Richard Brooksby
8504a81cf3
Eliminating mps_key_varargs and instead decoding deprecated varargs in one place in mpsi.c, so that each pool or other class doesn't have to deal with them.
...
Copied from Perforce
Change: 181638
ServerID: perforce.ravenbrook.com
2013-05-08 17:24:11 +01:00
Richard Brooksby
c0a8608bf7
Basically working keyword arguments, though vmparam is unsatisfactory.
...
Copied from Perforce
Change: 181545
ServerID: perforce.ravenbrook.com
2013-05-03 17:20:35 +01:00
Richard Brooksby
1bc62b27ef
First draft of keyword arguments. mainly checking in in order to try working with git fusion on this branch.
...
Copied from Perforce
Change: 181538
ServerID: perforce.ravenbrook.com
2013-05-02 17:55:07 +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