Ken Brown
b57067e8a0
Support the Cygwin build of MPS
...
* mps/code/prmccyi6.c:
* mps/code/cyi6gc.gmk: New files, for the Cygwin build.
* mps/code/config.h:
* mps/code/lockix.c:
* mps/code/prmcix.c:
* mps/code/protix.c:
* mps/code/protsgix.c:
* mps/code/pthrdext.c:
* mps/code/testthr.h:
* mps/code/thix.c:
* mps/code/vmix.c: Port to Cygwin.
* mps/configure.ac (x86_64-*-cygwin*/no): Add definitions for
Cygwin.
* mps/code/mps.c [MPS_PF_CYI6GC]:
* mps/code/mpstd.h: Define 64-bit Cygwin stuff.
* mps/code/gcbench.c: [MPS_OS_CY]:
* mps/code/djbench.c [MPS_OS_CY]: Include alloca.h.
* mps/code/arenacv.c (TEST_ARENA_SIZE) [MPS_OS_CY]: Increase to
make test pass. (Bug#74805)
* mps/code/arenavm.c (VMArenaCreate): Avoid compiler warning.
2025-10-08 10:33:45 -04:00
Richard Brooksby
38cc6e4f8e
Documenting deprecation of getpagesize().
2023-03-04 07:56:29 +00:00
Bruce Mitchener
322dc834d9
Unix: use sysconf(_sc_pagesize), not getpagesize()
...
The `getpagesize()` is a legacy function and is not available
in the default configurations on some platforms.
The documentation for `getpagesize()` recommends using the POSIX
`sysconf(_SC_PAGESIZE)` instead.
Additionally, `sysconf(_SC_PAGESIZE)` returns a `long` rather than
an `int`, so the code is updated to handle that as well.
Sources:
* https://man7.org/linux/man-pages/man2/getpagesize.2.html
* https://pubs.opengroup.org/onlinepubs/7908799/xsh/getpagesize.html
2023-03-04 14:11:09 +07:00
Richard Brooksby
8ab5806e31
Adding narrowing cast to suppress warning on fri6ll.
2023-01-11 18:18:51 +00:00
Gareth Rees
3818bf1e06
Handle errors from mmap and mprotect due to apple hardened runtime.
...
On Apple Silicon, when Hardened Runtime is in force and the
application lacks the "Allow Unsigned Executable Memory Entitlement",
mmap and mprotect return EACCES when an attempt is made to create or
modify memory so that it is simultaneously writable and executable.
This commit handles these cases by retrying the operation without the
PROT_EXEC flag, and setting global variables so that future operations
omit the flag.
2023-01-06 18:31:54 +00:00
Gareth Rees
f47c389a52
Fix indentation of second clause of license.
2020-08-30 10:13:06 +01:00
Gareth Rees
af0f431eda
Use https: instead of http: when linking to the ravenbrook web site.
2020-08-30 10:13:03 +01:00
Peter Jackson
4de2606846
Publish licence updates in code directory.
...
Publish minor changes to readme and configure files in main directory.
Main directory and code directory licence texts are now fully updated.
Copied from Perforce
Change: 196994
2020-06-11 17:05:40 +01:00
Gareth Rees
4eda4e85c7
Use tags with dots; regularize design references from code.
...
Copied from Perforce
Change: 195761
2018-11-29 17:12:29 +00:00
Gareth Rees
7b754520fd
Consistent order to prologue: include "mpm.h"; platform check; include other mps headers; include system headers; srcid.
...
Copied from Perforce
Change: 194107
2018-06-23 11:31:57 +01:00
Gareth Rees
307bc47730
Rename "mac os x" and "os x" to "macos", except for a few cases where for historical accuracy we want to continue to refer to the former name.
...
Copied from Perforce
Change: 193821
2018-06-15 12:15:36 +01:00
Gareth Rees
61a58b9b50
Fix problems noted by rb in review < https://info.ravenbrook.com/mail/2014/06/18/14-06-43/0/ >
...
Copied from Perforce
Change: 186667
ServerID: perforce.ravenbrook.com
2014-06-18 15:36:35 +01:00
Gareth Rees
ef7bb2c997
Catch-up merge from branch/2014-05-28/align to branch/2014-06-14/vm.
...
Copied from Perforce
Change: 186664
ServerID: perforce.ravenbrook.com
2014-06-17 15:52:16 +01:00
Gareth Rees
5fb05e31b6
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
513bc73827
Put the portable part of the vm interface in its own module.
...
Copied from Perforce
Change: 186630
ServerID: perforce.ravenbrook.com
2014-06-14 16:09:06 +01:00
Gareth Rees
22ff6914e2
Macros for vmbase etc.
...
Copied from Perforce
Change: 186626
ServerID: perforce.ravenbrook.com
2014-06-14 15:50:13 +01:00
Gareth Rees
e95af3fb0e
Store the vm descriptor in the vmarena and vmchunk structures.
...
Copied from Perforce
Change: 186624
ServerID: perforce.ravenbrook.com
2014-06-14 15:12:26 +01:00
Gareth Rees
060cf69bfb
Fix compilation on windows.
...
Copied from Perforce
Change: 186594
ServerID: perforce.ravenbrook.com
2014-06-13 18:18:06 +01:00
Gareth Rees
8d9b6c0884
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
f39706c2be
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
8c3e5886b4
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
cd291a5f7a
Merge branch/2014-06-11/grain into branch/2014-05-28/align.
...
Copied from Perforce
Change: 186561
ServerID: perforce.ravenbrook.com
2014-06-13 13:35:14 +01:00
Gareth Rees
3aabbcfa48
Rename vmgrainsize to vmpagesize (because it is in fact the operating system page size) and to avoid confusion with the arena grain size.
...
Copied from Perforce
Change: 186543
ServerID: perforce.ravenbrook.com
2014-06-12 17:18:50 +01:00
Gareth Rees
b12e31ed9d
Fix problems identified by dl in review < https://info.ravenbrook.com/mail/2014/06/12/15-04-02/0/ >.
...
Copied from Perforce
Change: 186542
ServerID: perforce.ravenbrook.com
2014-06-12 17:11:09 +01:00
Gareth Rees
26e8aecdf2
Rename grainsizecheck as arenagrainsizecheck.
...
Copied from Perforce
Change: 186506
ServerID: perforce.ravenbrook.com
2014-06-11 17:33:10 +01:00
Gareth Rees
41e2d84377
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
73f4dd72be
Configurable arena alignment on windows.
...
Copied from Perforce
Change: 186380
ServerID: perforce.ravenbrook.com
2014-05-30 13:53:01 +01:00
Gareth Rees
686fd83181
Don't lie about the reserved size.
...
Copied from Perforce
Change: 186376
ServerID: perforce.ravenbrook.com
2014-05-30 13:05:26 +01:00
Gareth Rees
4a59d4e9b7
Fix problems identified by rb in review < https://info.ravenbrook.com/mail/2014/05/29/13-01-02/0/ >.
...
Copied from Perforce
Change: 186347
ServerID: perforce.ravenbrook.com
2014-05-29 14:50:36 +01:00
Gareth Rees
b70e268929
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
4e22988865
Remove diag facility.
...
Copied from Perforce
Change: 182553
ServerID: perforce.ravenbrook.com
2013-06-05 18:35:40 +01:00
Gareth Rees
61743c36b4
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
714bf2aff2
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
402136905d
Removing half-finished code line. oops.
...
Copied from Perforce
Change: 181540
ServerID: perforce.ravenbrook.com
2013-05-02 17:59:58 +01:00
Richard Brooksby
098bf44a5e
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
ddcce429f4
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
1d0b04ae97
Fixing warnings revealed by xcode (clang).
...
Copied from Perforce
Change: 178898
ServerID: perforce.ravenbrook.com
2012-08-11 09:30:24 +01:00
David Lovemore
64192bbfa6
Adding casts to varargs in diagnostic output
...
Copied from Perforce
Change: 178092
ServerID: perforce.ravenbrook.com
2012-05-03 15:17:04 +01:00
Richard Kistruck
6ccac1bd84
Mps br/vmem: prepare for simple-chunk-return:
...
arenavm.c: VMFree is okay for testing chunk-ret; though just sparePagesPurge() for now;
diag.c: show what we want for using zcoll to show chunk-ret:
VM_ix_Create/Destroy
TraceStart, excpet only briefly for dyn-crit (why=2) and not at all for minor
locus.c: no newline on "condemn gens" diag please
tract.c: ChunkDecache is BROKEN; just add AVER to catch this for now
vmix.c: VM_ix_Create_ok/VM_ix_Destroy (vmw3.c needs similar)
zcoll.c:
release after mps_arena_collect!!!
make, collect, make, collect, to show chunk-ret
10MB arena means many chunks
None of this is releaseable quality of course.
Copied from Perforce
Change: 170071
ServerID: perforce.ravenbrook.com
2010-03-20 13:51:23 +00:00
David Jones
298232efce
Mps: linux: using vmix rather than vmli
...
Copied from Perforce
Change: 162974
ServerID: perforce.ravenbrook.com
2007-07-20 19:15:15 +01:00
David Jones
882a7893e4
Mps: removing "freebsd" from cut-and-paste mistake.
...
Copied from Perforce
Change: 161981
ServerID: perforce.ravenbrook.com
2007-03-22 14:21:41 +00:00
David Jones
6f40b456c7
Mps: replaced vmxc.c with vmix.c
...
Copied from Perforce
Change: 161917
ServerID: perforce.ravenbrook.com
2007-03-12 12:16:18 +00:00