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
c2383c4ec9
Remove unneeded headers.
...
Copied from Perforce
Change: 185248
ServerID: perforce.ravenbrook.com
2014-04-06 15:53:54 +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
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
2efd201955
Declaring result codes using a relational macro, so that tests can print more meaningful output, and to eliminate redundant code.
...
Copied from Perforce
Change: 184382
ServerID: perforce.ravenbrook.com
2014-02-19 11:55:43 +00:00
Gareth Rees
e88bcc5184
Document the intention behind mps_ld_isstale rather than the implementation: it captures the intention of testing whether a particular dependency is stale (even though the implementation in fact tests whether any dependency is stale). add new function mps_ls_isstale_any for expressing the intention of testing whether any dependencey is stale. the two functions have the same implementation at present, but the separation gives us the freedom to return a more precise result from mps_ld_isstale in future.
...
Copied from Perforce
Change: 182816
ServerID: perforce.ravenbrook.com
2013-06-20 16:25:08 +01:00
Gareth Rees
25bfea8ba8
Move the poolhasrange test to pool.c so that all frees (including internal ones) get the check.
...
Copied from Perforce
Change: 182783
ServerID: perforce.ravenbrook.com
2013-06-17 17:52:25 +01:00
Richard Brooksby
56645cdc0c
Merging branch/2013-05-17/emergency with major rework of mvt, mvff, and cbs.
...
Some parts of this are still ragged, and would not normally pass review, but this is a massive improvement to the existing code.
Copied from Perforce
Change: 182614
ServerID: perforce.ravenbrook.com
2013-06-08 10:57:57 +01:00
Gareth Rees
509ebcb215
Check that all addresses in the freed range belong to the pool, not just the base of the range.
...
Copied from Perforce
Change: 182602
ServerID: perforce.ravenbrook.com
2013-06-07 13:20:20 +01:00
Richard Brooksby
d14b8bbc81
Merging branch/2013-05-01/keyword-arguments to pick up keyword arguments for object formats.
...
Copied from Perforce
Change: 182562
ServerID: perforce.ravenbrook.com
2013-06-06 12:55:04 +01:00
Gareth Rees
aaf6e8b13b
New public function mps_fmt_create_k creates an object format using the keyword argument interface.
...
Deprecate the format variant structures (mps_fmt_A_s, mps_fmt_B_s, mps_fmt_auto_header_s, mps_fmt_fixed_s) and the old interface (mps_fmt_create_A, mps_fmt_create_B, mps_fmt_create_auto_header, mps_fmt_create_fixed).
Copied from Perforce
Change: 182277
ServerID: perforce.ravenbrook.com
2013-05-28 16:10:08 +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
Gareth Rees
ef4c41df55
Ensure the emergency branch compiles and runs on lii6gc:
...
No need for <string.h> in mpsi.c (this defines a function "index" on Linux).
Need more headers in range.c so that it will compile on its own.
Need UNUSED() declarations for some variables in cbstest.c.
Copied from Perforce
Change: 182113
ServerID: perforce.ravenbrook.com
2013-05-23 13:42:08 +01:00
Richard Brooksby
8acbc5780b
Quietly eliminating varargs to mps_alloc. they were never documented.
...
Copied from Perforce
Change: 181843
ServerID: perforce.ravenbrook.com
2013-05-16 03:07:50 +01:00
Gareth Rees
d0a8ac6e14
Rename mps_arena_create_args to mps_arena_create_k to match the documentation, and for consistency with mps_pool_create_k and mps_ap_create_k.
...
Copied from Perforce
Change: 181722
ServerID: perforce.ravenbrook.com
2013-05-11 19:17:06 +01:00
Richard Brooksby
688b5bf73d
Converting varags on buffer and ap creation into keyword argument lists.
...
Copied from Perforce
Change: 181680
ServerID: perforce.ravenbrook.com
2013-05-09 18:25:53 +01:00
Richard Brooksby
af44d1241f
Replacing varargs passed to seginit with keyword argument list.
...
Copied from Perforce
Change: 181679
ServerID: perforce.ravenbrook.com
2013-05-09 17:34:01 +01:00
Richard Brooksby
b323278e18
Implementing configurable maximum argument list length.
...
Copied from Perforce
Change: 181648
ServerID: perforce.ravenbrook.com
2013-05-08 23:47:38 +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
71b7e4f70a
Pushing varargs decoding into a pool class method. much simpler.
...
Copied from Perforce
Change: 181642
ServerID: perforce.ravenbrook.com
2013-05-08 22:43:51 +01:00
Richard Brooksby
d396431c25
Adding decoding of vararg debug options to debug pool classes.
...
Copied from Perforce
Change: 181639
ServerID: perforce.ravenbrook.com
2013-05-08 17:43:01 +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
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
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
Gareth Rees
db733f3932
Remove "mps_alert_collection_set" from public interface and remove its implementation and test case. client programs should use the messages interface to find out what the mps is doing.
...
Copied from Perforce
Change: 181119
ServerID: perforce.ravenbrook.com
2013-03-12 14:33:27 +00:00
Gareth Rees
0dd9586930
New type mps_label_t for telemetry labels.
...
Deprecate "candy machine" interface to telemetry control.
Implement and document straightforward get/set/reset interface.
Put a TODO referencing job003387 and job003388.
Copied from Perforce
Change: 180495
ServerID: perforce.ravenbrook.com
2012-11-16 16:42:41 +00:00
Gareth Rees
6c6d7a00d6
No need to include "mpsavm.h". the comment justifying it was bogus: "only for mps_space_create".
...
Copied from Perforce
Change: 180093
ServerID: perforce.ravenbrook.com
2012-10-26 09:51:12 +01:00
Gareth Rees
3bada6378b
Based on discussion with rb, reverse the sense of the comments on mps_ap_fill and mps_ap_trip.
...
Copied from Perforce
Change: 179971
ServerID: perforce.ravenbrook.com
2012-10-19 16:47:49 +01:00
Richard Brooksby
50c50c895b
Eliminating interface puns that break the strict aliasing rule. the last of the structure puns and casts, i think.
...
Copied from Perforce
Change: 179453
ServerID: perforce.ravenbrook.com
2012-09-12 20:00:04 +01:00
Richard Brooksby
513aabb046
Further elimination of type puns that violate the strict aliasing rule. this change eliminates puns on the format methods.
...
Copied from Perforce
Change: 179452
ServerID: perforce.ravenbrook.com
2012-09-12 19:45:27 +01:00
Richard Brooksby
9248316fb6
Further reduction of interface puns that violate the strict aliasing rule, this time in thread function types and the corresponding threadstruct.
...
Copied from Perforce
Change: 179451
ServerID: perforce.ravenbrook.com
2012-09-12 19:32:37 +01:00
Richard Brooksby
1518dc1e13
Cleaning up obsolete references to mps_space_t.
...
Copied from Perforce
Change: 179446
ServerID: perforce.ravenbrook.com
2012-09-12 18:26:06 +01:00
Richard Brooksby
1c9b8d7eb3
Removing enternal/external type puns from segregated allocation caches.
...
Copied from Perforce
Change: 179383
ServerID: perforce.ravenbrook.com
2012-09-10 11:12:28 +01:00
Richard Brooksby
75837d8376
Fixing type puns around arenapeek and arenapoke by allowing them to take a ref * to get a ref, rather than an addr.
...
Copied from Perforce
Change: 179382
ServerID: perforce.ravenbrook.com
2012-09-10 10:33:22 +01:00
Richard Brooksby
78d5f049f0
Eliminating type puns on scan states, location dependencies, and allocation points through the mps interface.
...
Now that we're recommending inlining with client code and optimising with -O2 or -O3, we can't afford any bug introduced by the strict aliasing rule.
Copied from Perforce
Change: 179322
ServerID: perforce.ravenbrook.com
2012-09-07 12:58:57 +01:00
Richard Brooksby
858e4ac0ac
Partial merge of branch/2012-07-23/cet-transform, excluding cet-specific parts.
...
Copied from Perforce
Change: 179309
ServerID: perforce.ravenbrook.com
2012-09-06 17:17:18 +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
be2a97a673
Checking and suppressing warnings revealed by higher level of optimisation and building from mps.c on freebsd.
...
Copied from Perforce
Change: 179195
ServerID: perforce.ravenbrook.com
2012-09-03 13:42:08 +01:00
Richard Brooksby
fa0bfed44e
Removing product-specific configuration, including dylan- and scriptworks-specific targets and config_prod configurations. we should support any necessary requirements generically.
...
It's now possible to write "cc -c mps.c" and get a sensible result.
Copied from Perforce
Change: 179169
ServerID: perforce.ravenbrook.com
2012-09-02 10:39:42 +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
7047e27cd1
Writing events into separate buffers by kind.
...
Always recording events into buffers, but only writing them to the telemetry stream if they're enabled.
Copied from Perforce
Change: 179136
ServerID: perforce.ravenbrook.com
2012-08-31 16:09:07 +01:00
Richard Kistruck
640b8b5cb8
Mps br/padding (fix w3i3m9 build) mpsi.c: help compiler see format is never uninitialised
...
Copied from Perforce
Change: 169862
ServerID: perforce.ravenbrook.com
2010-02-26 16:56:05 +00:00
Richard Kistruck
e2598917f4
mps br/padding: mps_addr_pool(), mps_addr_fmt() -- new mps functions
...
mps.h, mpsicv.c: implementation
mpsicv.c: new addr_pool_test(), to test them
w3gen.def: export them
walkt0.c: test them within mps_arena_formatted_objects_walk(). (Also checks against values passed to stepper function, and against what we expect).
tool/test-runner.py: add walkt0
Copied from Perforce
Change: 169861
ServerID: perforce.ravenbrook.com
2010-02-26 16:33:49 +00:00
Richard Kistruck
a563a76204
Mps br/timing: mps_alert_collection_set() -- client sets a callback
...
function; MPS calls it synchronously on collection start/stop
(immediately after posting start/stop message). The callback
receives two ints: alertcode (start|stop; see mps.h), and whycode
(trace->why). Note: callback is also called for heap walk
start/stop.
amcss.c: show start/stop alerts.
Copied from Perforce
Change: 166703
ServerID: perforce.ravenbrook.com
2008-11-12 15:07:04 +00:00
Richard Kistruck
38d28de534
Mps br/timing: new type "clock", internal equivalent of mps_clock_t.
...
Used for a field in messages. (More uses to follow).
Copied from Perforce
Change: 166697
ServerID: perforce.ravenbrook.com
2008-11-11 16:57:30 +00:00
Richard Kistruck
32031684e2
Mps br/timing: mpsi_check(): check that external and internal messsage types match.
...
Copied from Perforce
Change: 166696
ServerID: perforce.ravenbrook.com
2008-11-11 16:22:26 +00:00
Richard Kistruck
62fb0f32ae
Mps br/timing: hack in mps_clock_t
...
(Should go via new Clock type in mpmtypes, mpsi_check(), etc).
Copied from Perforce
Change: 166591
ServerID: perforce.ravenbrook.com
2008-10-31 17:14:37 +00:00
Richard Kistruck
f5c3940658
Mps br/timing: (re-order file contents) arrange message functions
...
into a consistent order:
- internal (MPM) interface -- functions for message originator;
- delivery (client) interface -- functions for recipient;
- message methods.
Copied from Perforce
Change: 166589
ServerID: perforce.ravenbrook.com
2008-10-31 12:23:24 +00:00
Richard Kistruck
81a735e690
mps br/timing: back out broken message.c & mpsi.c
...
Copied from Perforce
Change: 166586
ServerID: perforce.ravenbrook.com
2008-10-31 10:16:57 +00:00
Richard Kistruck
0c1a9c3dc7
Mps br/timing: (broken) snapshot; i want to back these out and rearrange
...
functions into a consistent order first
Copied from Perforce
Change: 166585
ServerID: perforce.ravenbrook.com
2008-10-31 10:10:19 +00:00