Commit Graph

227 Commits (master)

Author SHA1 Message Date
Jacques-Henri Jourdan 328ebc1ea3
Merge pull request #10025 from stedolan/memprof-custom
Track caml_alloc_custom_mem allocations with Statmemprof
2020-11-24 10:06:52 +01:00
Stephen Dolan 01c08d3c0c Clean up caml_alloc_shr 2020-11-17 11:59:05 +00:00
Stephen Dolan 3631d4b543 Track caml_alloc_custom_mem allocations with Statmemprof 2020-11-16 13:42:16 +00:00
David Allsopp 692bd73123 OCAMLRUNPARAM=b=2 => load debuginfo
Load the debug information during runtime startup if OCAMLRUNPARAM=b=2.
This guards against the specific case of running out of fds, since the
debug information can't then be loaded.
2018-12-11 10:17:04 +01:00
David Allsopp 43b28fac00 Improve error messages when loading backtrace info
Before, any errors when loading bytecode backtrace information were
fatal and the error message was potentially misleading.
2018-12-11 08:54:49 +01:00
Jacques-Henri Jourdan f83d71830d Memprof: provide the guarantee that an allocation callback is always run in the same thread the allocation takes place.
This is done by using a local entry array for each thread, containing
tracked blocks whose allocation callback has not yet been called.

This allows some simplification in the code running callbacks for
young allocations. Indeed, since the entry array is local to one
thread, we know for sure that it cannot be modified during a callback,
and therefore we no longer need to remember the indices of the
corresponding new entries.
2020-10-19 17:08:17 +02:00
Jacques-Henri Jourdan ea52bec84b Memprof: thread-local context is now stored as a pointer in systhread's data structures.
Reasons:
- Better abstraction in memprof.h
- Simpler Saving/restore functions
- We introduce a current's thread context, so that we don't need to do a spacial case for the current thread
2020-10-19 17:00:04 +02:00
Florian Angeletti 55973d1203 Bump magic numbers for 4.12 (and trunk) 2020-10-19 15:33:26 +02:00
Nicolás Ojeda Bär 67c9c0772e Remove Spacetime support in marshaller 2020-10-08 20:28:15 +02:00
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
Xavier Leroy af48d9fe8f
Add a naked pointers dynamic checker (#9956)
This is selected at configure-time, option --enable-naked-pointers-checker.

The major GC warns when it detects out-of-heap pointers that could cause the no-naked-pointers runtime system to crash.

This is supported on x86-64 only, but on all ports (Unix and Windows).

Added tests involving naked pointers in tests/runtime-naked-pointers

Co-authored-by: KC Sivaramakrishnan <kc@kcsrk.info>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
Co-authored-by: Enguerrand Decorne <decorne.en@gmail.com>
2020-10-05 14:44:31 +02:00
David Allsopp 001c2d1283 Restore Cygwin64 support 2020-09-21 13:36:03 +01:00
David Allsopp fed86fb598
Merge pull request #9924 from dra27/explicit-export-PR
Remaining functions requiring explicit export
2020-09-21 08:59:06 +01:00
David Allsopp 17cceab054 Remaining functions requiring explicit export 2020-09-18 12:11:20 +01:00
Sadiq Jaffer c10217818f
Garbage collector colours change (#9756) 2020-09-17 17:24:04 +02:00
David Allsopp 46da6eb4bc Tidy spacetime.h 2020-09-14 14:54:10 +01:00
David Allsopp 3b1d4dafe0
Eliminate caml_code_area globals (#9909) 2020-09-14 09:16:09 +01:00
David Allsopp 28789cd045
Merge pull request #9904 from dra27/unix-io-prims
Declare primitives used by unix in io.h
2020-09-11 09:35:31 +01:00
David Allsopp 95ea8a2d32
Merge pull request #9902 from dra27/main-cleanup
Declare caml_expand_command_line in osdeps.h
2020-09-11 09:34:47 +01:00
David Allsopp d889d8f565
Merge pull request #9901 from dra27/caml_main
Tidy caml_main declaration
2020-09-11 09:34:29 +01:00
David Allsopp 435babd6f8 Declare primitives used by unix in io.h 2020-09-10 16:34:24 +01:00
David Allsopp 503776deb4 Declare caml_expand_command_line in osdeps.h 2020-09-10 12:11:02 +01:00
David Allsopp 29408deb2c Tidy caml_main declaration 2020-09-10 12:05:46 +01:00
David Allsopp 121cae4801 Remove CAMLprim and CAMLexport from backtrace.h 2020-09-10 11:01:19 +01:00
David Allsopp df64b46a7c Remove dup. declaration of caml_sys_time_unboxed 2020-09-10 09:54:43 +01:00
David Allsopp 6dc2457036
Merge pull request #9884 from dra27/cygwin64-prereq-6
Missing declarations in io.h [Cygwin64 pre-req 6/6]
2020-09-09 09:24:34 +01:00
David Allsopp f62d519be7
Merge pull request #9882 from dra27/cygwin64-prereq-4
Tidy CAML_INTERNALS in minor_gc.h and memory.h [Cygwin64 pre-req 4/6]
2020-09-09 09:23:50 +01:00
Xavier Leroy 1b48b5aa3c
Merge pull request #9872 from xavierleroy/seek-text-channels
Revised {in,out}_channel_length and seek_in for channels in text mode
2020-09-08 09:52:22 +02:00
David Allsopp 422c20013d Remove CAMLexport from Cash-exported primitives 2020-09-07 13:54:08 +01:00
David Allsopp e0397de83b
Merge pull request #9881 from dra27/cygwin64-prereq-3
Remove unimplemented functions in caml/alloc.h [Cygwin64 pre-req 3/6]
2020-09-07 13:46:07 +01:00
David Allsopp 02c1577e7b
Merge pull request #9883 from dra27/cygwin64-prereq-5
Guard caml_fatal_uncaught_exception with CAML_INTERNALS [Cygwin64 pre-req 5/6]
2020-09-07 13:38:22 +01:00
David Allsopp bf05018a1a Formalise the Cash exports 2020-09-04 16:22:10 +01:00
David Allsopp 0f6d3a3128 Add missing channel declarations in caml/io.h 2020-09-04 16:21:03 +01:00
David Allsopp 0d4f1ba182 Guard caml_fatal_uncaught_exception with CAML_INTERNALS 2020-09-04 15:59:43 +01:00
David Allsopp c35dc17664 Guard heap functions with CAML_INTERNALS 2020-09-04 15:57:57 +01:00
David Allsopp 0fce1e36ae Guard most of minor_gc.h with CAML_INTERNALS 2020-09-04 15:53:44 +01:00
David Allsopp eb6d803222 caml_gc_dispatch doesn't need exporting 2020-09-04 15:53:29 +01:00
David Allsopp ff7da588d6 Add missing caml_ prefix in minor_gc.h 2020-09-04 15:51:54 +01:00
David Allsopp bd58bcff8d Remove unimplemented functions in caml/alloc.h 2020-09-04 15:41:29 +01:00
David Allsopp bab2d10a68 Declare caml_*_ops in headers 2020-09-04 15:25:49 +01:00
Xavier Leroy 09f2b9dd57 Revised {in,out}_channel_length and seek_in for channels in text mode
Under Windows, for channels opened in text mode, EOL conversion causes
a mismatch between the `offset` position cached in the
`struct channel` record and actual position in the file.

This commit turns off the use of the cached "offset" in the implementations
of `{in,out}_channel_length` and `seek_in`, calling `lseek` directly instead.

To support this, a new channel flag `CHANNEL_TEXT_MODE` was added.  It
is set for channels operating in text mode under Windows, when EOL
conversion is active.

Fixes: #9868
2020-09-01 20:33:39 +02:00
Stephen Dolan 41f0522df3
Use different symbol names for caml_do_local_roots on bytecode and native code (#9503) 2020-08-25 21:22:34 +01:00
David Allsopp 9a7a17c012 Add Sys.mkdir 2020-07-21 14:15:40 +01:00
Xavier Leroy 8b3ac9bcb2
Merge pull request #9722 from stedolan/eintr-again
EINTR-based signal handling: ensure that signals are handled
only at polling points, and that I/O locks are not held during signal
handling.
2020-07-28 19:20:57 +02:00
Xavier Leroy a0a1ba4f1e
Merge pull request #9699 from EduardoRFS/trunk-ios
Add support for iOS and macOS on ARM64
2020-07-28 16:40:55 +02:00
Stephen Dolan 63d516bda1 Avoid running signal handlers while holding locks in io.c 2020-07-27 17:29:39 +01:00
Stephen Dolan 32feddc1fc Do not run OCaml code inside signal handlers 2020-07-27 17:29:39 +01:00
Stephen Dolan e678885007 Lock channels before doing I/O
The debugger's use of channels doesn't support locking, but it
doesn't work on threaded programs anyway.
2020-07-27 17:29:39 +01:00
Xavier Leroy ba2b98608a
Merge pull request #9742 from jhjourdan/fix_7810
Make Ephemeron compatible with infix pointers.
2020-07-27 16:51:14 +02:00
EduardoRFS 8cd474f008 ios: Sys.command is not supported 2020-07-25 08:37:06 +00:00